Skip to content

Commit 685f6fe

Browse files
authored
bugfix issue #1020: JSON type in MySQL not supported in v3.2 (#1028)
1 parent 14fb80d commit 685f6fe

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4195,7 +4195,7 @@ ColDataType ColDataType():
41954195
(tk=<K_CHARACTER> | tk=<K_BIT>) [tk2=<K_VARYING>] { colDataType.setDataType(tk.image + (tk2!=null?" " + tk2.image:"")); }
41964196
| tk=<K_DOUBLE> [LOOKAHEAD(2) tk2=<K_PRECISION>] { colDataType.setDataType(tk.image + (tk2!=null?" " + tk2.image:"")); }
41974197
| ( tk=<S_IDENTIFIER> | tk=<K_DATETIMELITERAL> | tk=<K_DATE_LITERAL> | tk=<K_XML> | tk=<K_INTERVAL>
4198-
| tk=<DT_ZONE> | tk=<K_CHAR> | tk=<K_SET> | tk=<K_BINARY> )
4198+
| tk=<DT_ZONE> | tk=<K_CHAR> | tk=<K_SET> | tk=<K_BINARY> | tk=<K_JSON> )
41994199
{ colDataType.setDataType(tk.image); }
42004200
| tk=<K_UNSIGNED> tk2=<S_IDENTIFIER> {colDataType.setDataType(tk.image + " " + tk2.image);}
42014201
| LOOKAHEAD(2) tk=<K_SIGNED> tk2=<S_IDENTIFIER> {colDataType.setDataType(tk.image + " " + tk2.image);}

src/test/resources/RUBiS-create-requests.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,18 @@ true
365365
tmp_ids
366366
id.unique category
367367

368+
#begin
369+
create table test.json_test (
370+
c1 INTEGER PRIMARY KEY,
371+
c2 varchar(20) not null,
372+
c3 json default null
373+
)
374+
#end
375+
true
376+
test.json_test
377+
c1.unique c2 c3
378+
379+
368380
// -----------------------------------------------------------------------------------------------------------------------
369381
// Other tests
370382
// -----------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)