Commit 898333f8 authored by unknown's avatar unknown

Fix for bug #30200: mysqlbinlog.test: connection_id() not restored under ps-protocol

Problem: thd->thread_specific_used flag is not set executing a statement
containig connection_id() function using PS protocol, that leads to 
improper binlog event creation.

Fix: set the flag in the Item_func_connection_id::fix_fields().


sql/item_create.cc:
  Fix for bug #30200: mysqlbinlog.test: connection_id() not restored under ps-protocol
    - set the thd->thread_specific_used flag in the Item_func_connection_id::fix_fields()
      to have it properly set using PS protocol as well.
sql/item_func.cc:
  Fix for bug #30200: mysqlbinlog.test: connection_id() not restored under ps-protocol
    - set the thd->thread_specific_used flag in the Item_func_connection_id::fix_fields()
      to have it properly set using PS protocol as well.
sql/sql_parse.cc:
  Fix for bug #30200: mysqlbinlog.test: connection_id() not restored under ps-protocol
    - reset the thd->thread_specific_used flag in the mysql_reset_thd_for_next_command().
parent d0738596
...@@ -72,7 +72,6 @@ Item *create_func_connection_id(void) ...@@ -72,7 +72,6 @@ Item *create_func_connection_id(void)
{ {
THD *thd= current_thd; THD *thd= current_thd;
thd->lex->safe_to_cache_query= 0; thd->lex->safe_to_cache_query= 0;
thd->thread_specific_used= TRUE;
return new Item_func_connection_id(); return new Item_func_connection_id();
} }
......
...@@ -649,6 +649,7 @@ bool Item_func_connection_id::fix_fields(THD *thd, Item **ref) ...@@ -649,6 +649,7 @@ bool Item_func_connection_id::fix_fields(THD *thd, Item **ref)
{ {
if (Item_int_func::fix_fields(thd, ref)) if (Item_int_func::fix_fields(thd, ref))
return TRUE; return TRUE;
thd->thread_specific_used= TRUE;
value= thd->variables.pseudo_thread_id; value= thd->variables.pseudo_thread_id;
return FALSE; return FALSE;
} }
......
...@@ -5847,6 +5847,7 @@ void mysql_reset_thd_for_next_command(THD *thd) ...@@ -5847,6 +5847,7 @@ void mysql_reset_thd_for_next_command(THD *thd)
SERVER_QUERY_NO_GOOD_INDEX_USED); SERVER_QUERY_NO_GOOD_INDEX_USED);
DBUG_ASSERT(thd->security_ctx== &thd->main_security_ctx); DBUG_ASSERT(thd->security_ctx== &thd->main_security_ctx);
thd->tmp_table_used= 0; thd->tmp_table_used= 0;
thd->thread_specific_used= FALSE;
if (!thd->in_sub_stmt) if (!thd->in_sub_stmt)
{ {
if (opt_bin_log) if (opt_bin_log)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment