1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00

simplify CREATE TEMPORARY TABLE parser rule

as a bonus that makes CREATE TEMPORARY TEMPORARY TABLE illegal
This commit is contained in:
Sergei Golubchik
2015-06-19 19:46:12 +02:00
parent bfabaf6486
commit 794a895c4c
3 changed files with 11 additions and 18 deletions

View File

@@ -291,3 +291,5 @@ test.t1 repair status OK
test.t2 repair status OK
test.t3 repair status OK
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

View File

@@ -319,3 +319,9 @@ INSERT INTO t3 VALUES (101), (102), (103);
REPAIR TABLE t1, t2, t3;
DROP TABLES t1, t2, t3;
#
# CREATE TEMPORARY TEMPORARY TABLE
#
--error ER_PARSE_ERROR
create temporary temporary table t1 (a int);

View File

@@ -1717,8 +1717,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%type <num>
order_dir lock_option
udf_type opt_local opt_table_options table_options
table_option opt_no_write_to_binlog
udf_type opt_local opt_no_write_to_binlog
opt_temporary all_or_any opt_distinct
opt_ignore_leaves fulltext_options union_option
opt_not opt_union_order_or_limit
@@ -2444,7 +2443,7 @@ connection_name:
/* create a table */
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->create_info.init();
@@ -5578,20 +5577,6 @@ create_database_option:
| 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:
/* empty */
{
@@ -11960,7 +11945,7 @@ opt_if_exists:
opt_temporary:
/* empty */ { $$= 0; }
| TEMPORARY { $$= HA_LEX_CREATE_TMP_TABLE;; }
| TEMPORARY { $$= HA_LEX_CREATE_TMP_TABLE; }
;
/*
** Insert : add new data to table