Closed
Description
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:
[jenkins@41dceb4d72b3 bce7ae67]$ .tox/py39-cext-mysql/bin/python -m pytest \
\ --dburi 'mysql+mysqldb://scott:tiger@mariadb105/test?charset=utf8mb4' \
s test/dialect/mysql/test_dialect.py::DialectTest::test_special_encodings
============================= test session starts ==============================
platform linux -- Python 3.9.7, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 -- /home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/.tox/py39-cext-mysql/bin/python
cachedir: .pytest_cache
rootdir: /home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67, configfile: setup.cfg
plugins: forked-1.3.0, xdist-2.4.0
collected 1 item
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 260, in test_special_encodings
eq_(conn.dialect._connection_charset, enc)
File "/home/jenkins/workspace/sqlalchemy_gerrit/bce7ae67/test/../lib/sqlalchemy/testing/assertions.py", line 244, in eq_
assert a == b, msg or "%r != %r" % (a, b)
AssertionError: 'utf8mb3' != 'utf8'
assert 'utf8mb3' == 'utf8'
- utf8
+ utf8mb3
=========================== short test summary info ============================
FAILED test/dialect/mysql/test_dialect.py::DialectTest::test_special_encodings
============================== 1 failed in 0.09s ===============================
on CI, mariadb client is installed from maridb's RPMs:
# rpm -qa | grep -i mariadb
MariaDB-client-10.6.4-1.el8.x86_64
MariaDB-shared-10.6.4-1.el8.x86_64
MariaDB-devel-10.6.4-1.el8.x86_64
MariaDB-common-10.6.4-1.el8.x86_64
code that breaks with "utf8mb3" is at
sqlalchemy/lib/sqlalchemy/dialects/mysql/base.py
Line 3501 in 3b4b0a3
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
zzzeek commentedon Oct 2, 2021
on 1.4.25 on CI, stack trace:
we should likely backport to 1.3 unfortunately
sqla-tester commentedon Oct 2, 2021
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
sqla-tester commentedon Oct 2, 2021
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
support utf8mb3 char encoding fully for mysqlclient, others