Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b4ed688

Browse files
authored
test json - mariadb without JSON type (#1165)
MariaDB-11.0.1 removed the 5.5.5 version hack (MDEV-28910). MariaDB still doesn't support JSON as a type. Use get_mysql_vendor() == mysql for the final part of test_json.
1 parent bbd049f commit b4ed688

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pymysql/tests/test_basic.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,10 @@ def test_json(self):
323323
res = cur.fetchone()[0]
324324
self.assertEqual(json.loads(res), json.loads(json_str))
325325

326-
cur.execute("SELECT CAST(%s AS JSON) AS x", (json_str,))
327-
res = cur.fetchone()[0]
328-
self.assertEqual(json.loads(res), json.loads(json_str))
326+
if self.get_mysql_vendor(conn) == "mysql":
327+
cur.execute("SELECT CAST(%s AS JSON) AS x", (json_str,))
328+
res = cur.fetchone()[0]
329+
self.assertEqual(json.loads(res), json.loads(json_str))
329330

330331

331332
class TestBulkInserts(base.PyMySQLTestCase):

0 commit comments

Comments
 (0)