Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1f42a2b

Browse filesBrowse files
committed
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.
1 parent bbd049f commit 1f42a2b
Copy full SHA for 1f42a2b

File tree

Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed

‎pymysql/tests/test_basic.py

Copy file name to clipboardExpand all lines: pymysql/tests/test_basic.py
+4-3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.