Commit d42545fb authored by kostja@bodhi.(none)'s avatar kostja@bodhi.(none)

Fix create.test in --ps-protocol broken by the previous push.

parent 7289eccf
...@@ -4775,9 +4775,6 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table, ...@@ -4775,9 +4775,6 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
DBUG_ENTER("mysql_create_like_table"); DBUG_ENTER("mysql_create_like_table");
/* CREATE TABLE ... LIKE is not allowed for views. */
src_table->required_type= FRMTYPE_TABLE;
/* /*
By opening source table we guarantee that it exists and no concurrent By opening source table we guarantee that it exists and no concurrent
DDL operation will mess with it. Later we also take an exclusive DDL operation will mess with it. Later we also take an exclusive
......
...@@ -3577,20 +3577,30 @@ create2: ...@@ -3577,20 +3577,30 @@ create2:
| LIKE table_ident | LIKE table_ident
{ {
THD *thd= YYTHD; THD *thd= YYTHD;
TABLE_LIST *src_table;
LEX *lex= thd->lex; LEX *lex= thd->lex;
lex->create_info.options|= HA_LEX_CREATE_TABLE_LIKE; lex->create_info.options|= HA_LEX_CREATE_TABLE_LIKE;
if (!lex->select_lex.add_table_to_list(thd, $2, NULL, 0, TL_READ)) src_table= lex->select_lex.add_table_to_list(thd, $2, NULL, 0,
TL_READ);
if (! src_table)
MYSQL_YYABORT; MYSQL_YYABORT;
/* CREATE TABLE ... LIKE is not allowed for views. */
src_table->required_type= FRMTYPE_TABLE;
} }
| '(' LIKE table_ident ')' | '(' LIKE table_ident ')'
{ {
THD *thd= YYTHD; THD *thd= YYTHD;
TABLE_LIST *src_table;
LEX *lex= thd->lex; LEX *lex= thd->lex;
lex->create_info.options|= HA_LEX_CREATE_TABLE_LIKE; lex->create_info.options|= HA_LEX_CREATE_TABLE_LIKE;
if (!lex->select_lex.add_table_to_list(thd, $3, NULL, 0, TL_READ)) src_table= lex->select_lex.add_table_to_list(thd, $3, NULL, 0,
TL_READ);
if (! src_table)
MYSQL_YYABORT; MYSQL_YYABORT;
/* CREATE TABLE ... LIKE is not allowed for views. */
src_table->required_type= FRMTYPE_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