summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 254baf24c71..31e3baca764 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1679,6 +1679,10 @@ static bool mysql_test_create_table(Prepared_statement *stmt)
if (select_lex->item_list.elements)
{
+ /* Base table and temporary table are not in the same name space. */
+ if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE))
+ create_table->open_type= OT_BASE_ONLY;
+
if (open_normal_and_derived_tables(stmt->thd, lex->query_tables,
MYSQL_OPEN_FORCE_SHARED_MDL))
DBUG_RETURN(TRUE);