Commit 794a895c authored by Sergei Golubchik's avatar Sergei Golubchik

simplify CREATE TEMPORARY TABLE parser rule

as a bonus that makes CREATE TEMPORARY TEMPORARY TABLE illegal
parent bfabaf64
...@@ -291,3 +291,5 @@ test.t1 repair status OK ...@@ -291,3 +291,5 @@ test.t1 repair status OK
test.t2 repair status OK test.t2 repair status OK
test.t3 repair status OK test.t3 repair status OK
DROP TABLES t1, t2, t3; DROP TABLES t1, t2, t3;
create temporary temporary table t1 (a int);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'temporary table t1 (a int)' at line 1
...@@ -319,3 +319,9 @@ INSERT INTO t3 VALUES (101), (102), (103); ...@@ -319,3 +319,9 @@ INSERT INTO t3 VALUES (101), (102), (103);
REPAIR TABLE t1, t2, t3; REPAIR TABLE t1, t2, t3;
DROP TABLES t1, t2, t3; DROP TABLES t1, t2, t3;
#
# CREATE TEMPORARY TEMPORARY TABLE
#
--error ER_PARSE_ERROR
create temporary temporary table t1 (a int);
...@@ -1717,8 +1717,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); ...@@ -1717,8 +1717,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%type <num> %type <num>
order_dir lock_option order_dir lock_option
udf_type opt_local opt_table_options table_options udf_type opt_local opt_no_write_to_binlog
table_option opt_no_write_to_binlog
opt_temporary all_or_any opt_distinct opt_temporary all_or_any opt_distinct
opt_ignore_leaves fulltext_options union_option opt_ignore_leaves fulltext_options union_option
opt_not opt_union_order_or_limit opt_not opt_union_order_or_limit
...@@ -2444,7 +2443,7 @@ connection_name: ...@@ -2444,7 +2443,7 @@ connection_name:
/* create a table */ /* create a table */
create: create:
create_or_replace opt_table_options TABLE_SYM opt_if_not_exists table_ident create_or_replace opt_temporary TABLE_SYM opt_if_not_exists table_ident
{ {
LEX *lex= thd->lex; LEX *lex= thd->lex;
lex->create_info.init(); lex->create_info.init();
...@@ -5578,20 +5577,6 @@ create_database_option: ...@@ -5578,20 +5577,6 @@ create_database_option:
| default_charset {} | default_charset {}
; ;
opt_table_options:
/* empty */ { $$= 0; }
| table_options { $$= $1;}
;
table_options:
table_option { $$=$1; }
| table_option table_options { $$= $1 | $2; }
;
table_option:
TEMPORARY { $$=HA_LEX_CREATE_TMP_TABLE; }
;
opt_if_not_exists_table_element: opt_if_not_exists_table_element:
/* empty */ /* empty */
{ {
...@@ -11960,7 +11945,7 @@ opt_if_exists: ...@@ -11960,7 +11945,7 @@ opt_if_exists:
opt_temporary: opt_temporary:
/* empty */ { $$= 0; } /* empty */ { $$= 0; }
| TEMPORARY { $$= HA_LEX_CREATE_TMP_TABLE;; } | TEMPORARY { $$= HA_LEX_CREATE_TMP_TABLE; }
; ;
/* /*
** Insert : add new data to table ** Insert : add new data to table
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment