-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
maridab client libs also report utf8mb3 in some way , need to handle it #7136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
on 1.4.25 on CI, stack trace: test/dialect/mysql/test_dialect.py::DialectTest::test_special_encodings FAILED [100%]
=================================== FAILURES ===================================
______________________ DialectTest.test_special_encodings ______________________
Traceback (most recent call last):
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/dialect/mysql/test_dialect.py", line 259, in test_special_encodings
conn = eng.connect()
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/engine/base.py", line 3194, in connect
return self._connection_cls(self, close_with_result=close_with_result)
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/engine/base.py", line 96, in __init__
else engine.raw_connection()
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/engine/base.py", line 3273, in raw_connection
return self._wrap_pool_connect(self.pool.connect, _connection)
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/engine/base.py", line 3240, in _wrap_pool_connect
return fn()
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/pool/base.py", line 310, in connect
return _ConnectionFairy._checkout(self)
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/pool/base.py", line 868, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/pool/base.py", line 476, in checkout
rec = pool._do_get()
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/pool/impl.py", line 146, in _do_get
self._dec_overflow()
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/util/langhelpers.py", line 70, in __exit__
compat.raise_(
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/util/compat.py", line 207, in raise_
raise exception
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/pool/impl.py", line 143, in _do_get
return self._create_connection()
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/pool/base.py", line 256, in _create_connection
return _ConnectionRecord(self)
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/pool/base.py", line 371, in __init__
self.__connect()
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/pool/base.py", line 677, in __connect
pool.dispatch.connect.for_modify(
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/event/attr.py", line 329, in _exec_w_sync_on_first_run
self(*args, **kw)
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/event/attr.py", line 343, in __call__
fn(*args, **kw)
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/util/langhelpers.py", line 1691, in go
return once_fn(*arg, **kw)
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/engine/create.py", line 686, in first_connect
dialect.initialize(c)
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/dialects/mysql/base.py", line 2954, in initialize
self._detect_sql_mode(connection)
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/dialects/mysql/base.py", line 3411, in _detect_sql_mode
self._sql_mode = row[1] or ""
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/dialects/mysql/base.py", line 3519, in __getitem__
return item.decode(self.charset)
LookupError: unknown encoding: utf8mb3
=========================== short test summary info ============================
FAILED test/dialect/mysql/test_dialect.py::DialectTest::test_special_encodings
============================== 1 failed in 0.09s =============================== we should likely backport to 1.3 unfortunately |
Mike Bayer has proposed a fix for this issue in the master branch: support utf8mb3 char encoding fully for mysqlclient, others https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3125 |
Mike Bayer has proposed a fix for this issue in the rel_1_3 branch: support utf8mb3 char encoding fully for mysqlclient, others https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3126 |
Fixes to accommodate for the MariaDB 10.6 series, including backwards incompatible changes in both the mariadb-connector Python driver as well as the native 10.6 client libraries that are used automatically by the mysqlclient DBAPI. The "utf8mb3" encoding symbol is now reported by these client libraries when the encoding is stated as "utf8", leading to lookup and encoding errors within the MySQL dialect that does not expect this symbol. Updates to both the MySQL base library to accommodate for this utf8mb3 symbol being reported as well as to the test suite. Thanks to Georg Richter for support. Fixes: #7136 Fixes: #7115 Change-Id: I655d9d9868aef76037023d0c602b8a7c881780b0 (cherry picked from commit f43e65f9b557b2d110141137a0216c661ba038b4)
continuing from #7115 it seems likely that the new Mariadb 10.6 client is also returniung "utf8mb3" for client encoding , which will break for SQLAlchemy prior to the #7115 commit because we try to use that encoding at the Python level. we see this via failure on CI:
on CI, mariadb client is installed from maridb's RPMs:
code that breaks with "utf8mb3" is at
sqlalchemy/lib/sqlalchemy/dialects/mysql/base.py
Line 3501 in 3b4b0a3
The text was updated successfully, but these errors were encountered: