summaryrefslogtreecommitdiff
path: root/sql/temporary_tables.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-12-07 22:15:38 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2019-12-09 19:46:57 +0100
commit864abd362c2a1594506cfae020e6c60bf80596a8 (patch)
tree796ebc293a9f99d2f367de3c991f89f807a8ace7 /sql/temporary_tables.cc
parentc9b9eb331570704d020fcc7c7894f19febe7f26d (diff)
downloadmariadb-git-bb-10.2-MDEV-18460.tar.gz
MDEV-18460: Server crashed in strmake / tdc_create_key / THD::create_tmp_table_def_keybb-10.2-MDEV-18460
When there is a WITH clause we postpone check for tables without database for later stages when tables in WITH will be defined. But we should not try to open such tables as temporary tables because temporary tables always belong to a some database.
Diffstat (limited to 'sql/temporary_tables.cc')
-rw-r--r--sql/temporary_tables.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc
index b97e0334f0d..e2179a71625 100644
--- a/sql/temporary_tables.cc
+++ b/sql/temporary_tables.cc
@@ -338,6 +338,13 @@ bool THD::open_temporary_table(TABLE_LIST *tl)
DBUG_RETURN(false);
}
+ if (!tl->db)
+ {
+ DBUG_PRINT("info",
+ ("Table reference to a temporary table must have database set"));
+ DBUG_RETURN(false);
+ }
+
/*
Temporary tables are not safe for parallel replication. They were
designed to be visible to one thread only, so have no table locking.