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

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test json - mariadb without JSON type
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.
  • Loading branch information
grooverdan committed Mar 26, 2024
commit 1f42a2ba25242753058997fbb290e47fbbffcb1d
7 changes: 4 additions & 3 deletions pymysql/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,10 @@ def test_json(self):
res = cur.fetchone()[0]
self.assertEqual(json.loads(res), json.loads(json_str))

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


class TestBulkInserts(base.PyMySQLTestCase):
Expand Down