Skip to content

Commit 13c44c4

Browse files
committed
Add JSON field type and include it in TEXT_TYPES list to prevent setting the charset of JSON field types to 'ascii' and treat JSON field type like BINARY types to prevent encoding issue
1 parent de3b658 commit 13c44c4

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

pymysql/connections.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def _makefile(sock, mode):
8888
FIELD_TYPE.BLOB,
8989
FIELD_TYPE.LONG_BLOB,
9090
FIELD_TYPE.MEDIUM_BLOB,
91+
FIELD_TYPE.JSON,
9192
FIELD_TYPE.STRING,
9293
FIELD_TYPE.TINY_BLOB,
9394
FIELD_TYPE.VAR_STRING,

pymysql/constants/FIELD_TYPE.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
NEWDATE = 14
1818
VARCHAR = 15
1919
BIT = 16
20+
JSON = 245
2021
NEWDECIMAL = 246
2122
ENUM = 247
2223
SET = 248

0 commit comments

Comments
 (0)