Table reflection broken on MySQL before 4.1.1

Issue #609 resolved
Former user created an issue

(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)

  1. jek
    • 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.

  2. Log in to comment