diff --git a/sql/item_create.cc b/sql/item_create.cc index fa15b992e5c14c0c8168c2b63e9c8b1663e80a73..06996cdaa3b456caaa2efc9a42845445dd998997 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -2861,6 +2861,7 @@ Item* Create_func_connection_id::create(THD *thd) { thd->lex->safe_to_cache_query= 0; + thd->thread_specific_used= TRUE; return new (thd->mem_root) Item_func_connection_id(); } diff --git a/sql/log_event.cc b/sql/log_event.cc index 7fbf8f8bd00aa2c8829b001434376bcfe8a1bd69..62b90986cfd475e2e272a1eb55a88926eaa8de3a 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1479,9 +1479,8 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, ulong query_length, bool using_trans, bool suppress_use, THD::killed_state killed_status_arg) :Log_event(thd_arg, - ((thd_arg->tmp_table_used || thd_arg->thread_specific_used) ? - LOG_EVENT_THREAD_SPECIFIC_F : 0) | - (suppress_use ? LOG_EVENT_SUPPRESS_USE_F : 0), + (thd_arg->thread_specific_used ? LOG_EVENT_THREAD_SPECIFIC_F : 0) | + (suppress_use ? LOG_EVENT_SUPPRESS_USE_F : 0), using_trans), data_buf(0), query(query_arg), catalog(thd_arg->catalog), db(thd_arg->db), q_len((uint32) query_length), @@ -2914,8 +2913,7 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex, enum enum_duplicates handle_dup, bool ignore, bool using_trans) :Log_event(thd_arg, - (thd_arg->tmp_table_used || thd_arg->thread_specific_used) ? - LOG_EVENT_THREAD_SPECIFIC_F : 0, + thd_arg->thread_specific_used ? LOG_EVENT_THREAD_SPECIFIC_F : 0, using_trans), thread_id(thd_arg->thread_id), slave_proxy_id(thd_arg->variables.pseudo_thread_id), diff --git a/sql/sql_base.cc b/sql/sql_base.cc index f131901027053d8bf1aef22b6786efede2ac72d0..138f8acecb67029a0f5e926513d30c3e5780a23c 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2277,7 +2277,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, } table->query_id= thd->query_id; table->clear_query_id= 1; - thd->tmp_table_used= 1; + thd->thread_specific_used= TRUE; DBUG_PRINT("info",("Using temporary table")); goto reset; } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 514de445b567fc4c89acb76f61676c843eac94a0..e658f2f9a604b3af80562973e63b773a999a1ab0 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -394,7 +394,7 @@ THD::THD() count_cuted_fields= CHECK_FIELD_IGNORE; killed= NOT_KILLED; db_length= col_access=0; - query_error= tmp_table_used= thread_specific_used= 0; + query_error= thread_specific_used= FALSE; hash_clear(&handler_tables_hash); tmp_table=0; used_tables=0; diff --git a/sql/sql_class.h b/sql/sql_class.h index 38782c57a400b5d6640d84b8501a9ede9b1738f9..3a818490c76f6742db28fa196f1f0a567bfca587 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1405,7 +1405,6 @@ class THD :public Statement, bool substitute_null_with_insert_id; bool in_lock_tables; bool query_error, bootstrap, cleanup_done; - bool tmp_table_used; /** is set if some thread specific value(s) used in a statement. */ bool thread_specific_used; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 93887db88e13f11b6ba042d3c8107bf7c358cef7..244df65a2ee8c3ab88b7f708598a7e1124eedbe4 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5150,7 +5150,7 @@ void mysql_reset_thd_for_next_command(THD *thd) thd->no_trans_update.all= FALSE; } DBUG_ASSERT(thd->security_ctx== &thd->main_security_ctx); - thd->tmp_table_used= 0; + thd->thread_specific_used= FALSE; if (!thd->in_sub_stmt) { if (opt_bin_log) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 33448ea3c5f907c9206074027888d4019f01657d..219e536955ac85f1046a5167bcb381e152d3b141 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1656,7 +1656,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, on the table name. */ pthread_mutex_unlock(&LOCK_open); - thd->tmp_table_used= tmp_table_deleted; + thd->thread_specific_used|= tmp_table_deleted; error= 0; if (wrong_tables.length()) { @@ -3408,7 +3408,7 @@ bool mysql_create_table_no_lock(THD *thd, (void) rm_temporary_table(create_info->db_type, path); goto unlock_and_end; } - thd->tmp_table_used= 1; + thd->thread_specific_used= TRUE; } /*