diff options
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 9c41ee57a21..684a13d4679 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1491,8 +1491,21 @@ static bool mysql_test_create_table(Prepared_statement *stmt) if (select_lex->item_list.elements) { + if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)) + { + lex->link_first_table_back(create_table, link_to_local); + create_table->create= TRUE; + } + + if (open_and_lock_tables(stmt->thd, lex->query_tables)) + DBUG_RETURN(TRUE); + + if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)) + create_table= lex->unlink_first_table(&link_to_local); + select_lex->context.resolve_in_select_list= TRUE; - res= select_like_stmt_test_with_open_n_lock(stmt, tables, 0, 0); + + res= select_like_stmt_test(stmt, 0, 0); } /* put tables back for PS rexecuting */ |