diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2014-01-29 19:00:43 -0500 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2014-01-29 19:00:43 -0500 |
commit | ecc2c96c9d9b0fb5d94a1203d3ffa1a2d6c036b7 (patch) | |
tree | 3798790cf0141d8074a1c935dd9d7a9c644de0e4 /sql/sql_parse.cc | |
parent | d2c72da610074afe95959094a11f95b29a741f29 (diff) | |
parent | 6b6d40fa6ca1fe36f2a51c2723c58dfb3fc025bb (diff) | |
download | mariadb-git-ecc2c96c9d9b0fb5d94a1203d3ffa1a2d6c036b7.tar.gz |
Merge of maria/5.5 into maria-5.5-galera.
bzr merge -r tag:mariadb-5.5.35 maria/5.5
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d497b6d1263..c091d526220 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2183,6 +2183,7 @@ mysql_execute_command(THD *thd) bool have_table_map_for_update= FALSE; #endif DBUG_ENTER("mysql_execute_command"); + #ifdef WITH_PARTITION_STORAGE_ENGINE thd->work_part_info= 0; #endif @@ -4976,6 +4977,7 @@ finish: DBUG_ASSERT(!thd->in_active_multi_stmt_transaction() || thd->in_multi_stmt_transaction_mode()); + lex->unit.cleanup(); if (! thd->in_sub_stmt) { @@ -5008,7 +5010,6 @@ finish: #endif } - lex->unit.cleanup(); /* Free tables */ thd_proc_info(thd, "closing tables"); close_thread_tables(thd); @@ -6695,7 +6696,11 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, ptr->schema_table= schema_table; } ptr->select_lex= lex->current_select; - ptr->cacheable_table= 1; + /* + We can't cache internal temporary tables between prepares as the + table may be deleted before next exection. + */ + ptr->cacheable_table= !table->is_derived_table(); ptr->index_hints= index_hints_arg; ptr->option= option ? option->str : 0; /* check that used name is unique */ |