diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index df34e5b80bc..516be85b7be 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -310,3 +310,10 @@ json_length('{}') select json_length('[1, 2, {"a": 3}]'); json_length('[1, 2, {"a": 3}]') 3 +create table json (j INT); +show create table json; +Table Create Table +json CREATE TABLE `json` ( + `j` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table json; diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index 357f223f579..73b91efab87 100644 --- a/mysql-test/t/func_json.test +++ b/mysql-test/t/func_json.test @@ -135,3 +135,8 @@ select json_depth('[[[1,2,3],"s"], {}, []]'); select json_length(''); select json_length('{}'); select json_length('[1, 2, {"a": 3}]'); + +create table json (j INT); +show create table json; +drop table json; + diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index d45c7431e82..da7fb37ef89 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -13235,10 +13235,11 @@ opt_extended_describe: opt_format_json: /* empty */ {} - | FORMAT_SYM '=' JSON_SYM { Lex->explain_json= true; } | FORMAT_SYM '=' ident_or_text { - if (!my_strcasecmp(system_charset_info, $3.str, "TRADITIONAL")) + if (!my_strcasecmp(system_charset_info, $3.str, "JSON")) + Lex->explain_json= true; + else if (!my_strcasecmp(system_charset_info, $3.str, "TRADITIONAL")) DBUG_ASSERT(Lex->explain_json==false); else my_yyabort_error((ER_UNKNOWN_EXPLAIN_FORMAT, MYF(0), $3.str)); @@ -14738,6 +14739,7 @@ keyword_sp: | IPC_SYM {} | ISOLATION {} | ISSUER_SYM {} + | JSON_SYM {} | INSERT_METHOD {} | KEY_BLOCK_SIZE {} | LAST_VALUE {}