test json - mariadb without JSON type (#1165) · PyMySQL/PyMySQL@b4ed688 · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
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

Lines changed: 4 additions & 3 deletions
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)

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.