Skip to content

sqlalchemy 0.9.8 got exception on getting has_utf8_bin value from mysql 4.1.x server #3274

@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Donghyun Kim

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


Attachments: tt.patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmysql

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions