- changed status to resolved
sqlalchemy 0.9.8 got exception on getting has_utf8_bin value from mysql 4.1.x server
sqlalchemy 0.9.8 w/ mysql 4.1.x servers raised exception on running "show collation where Charset
= 'utf8' and Collation
= 'utf8_bin'" sql statement which is supported only mysql >= 5.0
To support mysql 4.1.x servers, this should be fixed (attached simple ignore exception patch)
here is the error
...
File "../trunk/virtualenv/local/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 86, in _check_unicode_returns
self.identifier_preparer.quote("Collation")
File "../trunk/virtualenv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 659, in scalar
return self.execute(object, multiparams, *params).scalar()
File "../trunk/virtualenv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 721, in execute
return self._execute_text(object, multiparams, params)
File "../trunk/virtualenv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 870, in _execute_text
statement, parameters
File "../trunk/virtualenv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 958, in _execute_context
context)
File "../trunk/virtualenv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1159, in _handle_dbapi_exception
exc_info
File "../trunk/virtualenv/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File "../trunk/virtualenv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
context)
File "../trunk/virtualenv/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 436, in do_execute
cursor.execute(statement, parameters)
File "../trunk/virtualenv/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
self.errorhandler(self, exc, value)
File "../trunk/virtualenv/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
sqlalchemy.exc.ProgrammingError: (ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where Charset
= 'utf8' and Collation
= 'utf8_bin'' at line 1") "show collation where Charset
= 'utf8' and Collation
= 'utf8_bin'" ()
Comments (5)
-
repo owner -
repo owner - Added a version check to the MySQLdb dialect surrounding the
check for 'utf8_bin' collation, as this fails on MySQL server < 5.0.
fixes
#3274
(cherry picked from commit 00aaaa4bd4aa150ff9964bf2c00b1404d2e8a140)
→ <<cset 10f855f3184a>>
- Added a version check to the MySQLdb dialect surrounding the
check for 'utf8_bin' collation, as this fails on MySQL server < 5.0.
fixes
-
repo owner please confirm that 10f855f3184a resolves this, as I can't do a complete test against 4.1, thanks.
-
reporter just confirmed that your fix works good.
-
repo owner great, thanks !
- Log in to comment
#3274→ <<cset 00aaaa4bd4aa>>