Browse Source

MDEV-11440 JSON has become a reserved word in MariaDB.

'JSON' made possible identifier.
pull/274/head
Alexey Botchkov 9 years ago
parent
commit
486079d159
  1. 7
      mysql-test/r/func_json.result
  2. 5
      mysql-test/t/func_json.test
  3. 6
      sql/sql_yacc.yy

7
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;

5
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;

6
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 {}

Loading…
Cancel
Save