* Support multibyte utf8 return values with new versions of MariaDB. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mysqlclient?expand=0&rev=26
24 lines
1.1 KiB
Diff
24 lines
1.1 KiB
Diff
Index: mysqlclient-2.0.3/tests/test_MySQLdb_capabilities.py
|
|
===================================================================
|
|
--- mysqlclient-2.0.3.orig/tests/test_MySQLdb_capabilities.py
|
|
+++ mysqlclient-2.0.3/tests/test_MySQLdb_capabilities.py
|
|
@@ -189,12 +189,14 @@ VALUES (1,
|
|
with closing(connection_factory(**kwargs)) as conn:
|
|
with closing(conn.cursor()) as c:
|
|
c.execute("SELECT CHARSET(%s)", (MySQLdb.Binary(b"raw bytes"),))
|
|
- self.assertEqual(
|
|
- c.fetchall()[0][0], "binary" if binary_prefix else "utf8"
|
|
- )
|
|
+ res = ("utf8", "utf8mb3", "utf8mb4")
|
|
+ if binary_prefix:
|
|
+ self.assertEqual(c.fetchall()[0][0], "binary")
|
|
+ else:
|
|
+ self.assertIn(c.fetchall()[0][0], res)
|
|
# normal strings should not get prefix
|
|
c.execute("SELECT CHARSET(%s)", ("str",))
|
|
- self.assertEqual(c.fetchall()[0][0], "utf8")
|
|
+ self.assertIn(c.fetchall()[0][0], res)
|
|
|
|
|
|
if __name__ == "__main__":
|