- attached mysql.patch
Table reflection broken on MySQL before 4.1.1
(As mentioned at http://groups.google.com/group/sqlalchemy/browse_thread/thread/cd26a3b94b8a342d)
I just noticed that autoloading of tables on old versions of MySQL is broken (I'm using 3.23.58, but I believe the problem will occur up to 4.1.1)
The problem is that reflecttable tries to use the 'character_set_results' system variable, which was only introduced in 4.1.1. The attached patch prevents the exception that occurs if it is not present, but I don't know if that is the correct way to fix it (should it be decoded using some default encoding perhaps?)
I don't know how concerned you are about supporting such an old version of MySQL, and I also realise that table reflection is a nice-to-have feature rather than a necessity, but it's just so convenient :-)
MySQL reference for 'character_set_results': http://www.mysql.org/doc/refman/4.1/en/server-system-variables.html#option_mysqld_character_set_results
Comments (5)
-
Account Deleted -
- changed milestone to 0.4.0
- assigned issue to
Hopefully reflection will be pretty solid and comprehensive 3.23 -> 6 in the SA 0.4 branch. But DDL generation for < 4.1 probably will not be.
-
- changed milestone to 0.3.9
Ok, this doesn't need to wait for 0.4. 81f42181f431eb8ea96c94ee8a2d798f11a296e7 should address character set detection on MySQL 3-6 and all versions of the driver I've seen in the wild.
-
- changed status to resolved
-
repo owner - removed milestone
Removing milestone: 0.3.9 (automated comment)
- Log in to comment
Patch to disable decoding if character_set_results is not present