Hi there,

I have been using ORM vertical partitioning for a while with MySQL 5.1.58
and MyISAM tables and SQLAlchemy 0.7.2.

I have recently switched over to using InnoDB tables and my vertical
partitioning table creation is failing part-way in with an "errno 105" code.
I have confirmed that all the tables that *did* get created are using an
InnoDB engine, so having stray MyISAM tables does not appear to be the
problem.

I have found a fix for the SQL that SQLAlchemy generates (and that MySQL
barfs on) that allows the table creation to succeed, which involves simply
prefixing SQLAlchemy's CREATE TABLE  foreign key references with the
database name. SQLAlchemy generates this line below, which also fails with
errno 105 when I paste it into MySQL monitor, just like when executed by
SQLA directly:

FOREIGN KEY(project_id) REFERENCES projects (id)

When I change it to this, table creation succeeds in mySQL monitor:

FOREIGN KEY(project_id) REFERENCES car_res.projects (id)

Basically, "ForeignKey("projects.id") seems sufficient for SQLA to define
the foreign key relationship, but MySQL seems to be wanting
"car_res.projects(id)" to appear in the FOREIGN KEY SQL, instead of
"projects(id)".

So I'm a bit confused. Is SQLA to blame for not including this prefix in
vertical partitioning table creation scenarios, or is there some bug in my
code somewhere that is causing MySQL to barf or SQLA to generate incorrect
SQL? I have some basic vertical partitioning test code that uses InnoDB with
two tables, and for my basic test, it seems like the "database." prefix is
*not* required by MySQL to successfully create tables.

Anyone have any idea about what might be going on?

Regards,

Daniel

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to