summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2013-07-11 16:27:57 +0300
committerunknown <sanja@montyprogram.com>2013-07-11 16:27:57 +0300
commitb8d9889e801e83be229bdd1b0a7dfe00eb93efa2 (patch)
tree164e9daf2b2e4ceab28ecd4e39612dfa676d01c9 /sql/sql_base.cc
parent11c737f76eb62268b617c087475eae73ec32b9af (diff)
downloadmariadb-git-b8d9889e801e83be229bdd1b0a7dfe00eb93efa2.tar.gz
added lost part about preopened temporary tables
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 7613facfe67..60f9c4d5cea 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -4574,8 +4574,19 @@ open_and_process_table(THD *thd, LEX *lex, TABLE_LIST *tables,
tables->db, tables->table_name, tables)); //psergey: invalid read of size 1 here
(*counter)++;
- /* Check if we are trying to create a temporary table */
- if (tables->open_type == OT_TEMPORARY_ONLY)
+ /*
+ Not a placeholder: must be a base/temporary table or a view. Let us open it.
+ */
+ if (tables->table)
+ {
+ /*
+ If this TABLE_LIST object has an associated open TABLE object
+ (TABLE_LIST::table is not NULL), that TABLE object must be a pre-opened
+ temporary table.
+ */
+ DBUG_ASSERT(is_temporary_table(tables));
+ }
+ else if (tables->open_type == OT_TEMPORARY_ONLY)
{
/*
OT_TEMPORARY_ONLY means that we are in CREATE TEMPORARY TABLE statement.