List:Commits« Previous MessageNext Message »
From:He Zhenxing Date:April 23 2010 7:24am
Subject:Re: bzr commit into mysql-trunk-bugfixing branch
(alfranio.correia:3015) Bug#53075
View as plain text  
Hi Alfranio,

Well done! I think the patch is good, the solution is straightforward,
only that I think a test case is missing, patch approved after
addressing this.

Alfranio Correia wrote:
> #At
> file:///home/acorreia/workspace.sun/repository.mysql/bzrwork/bug-53075/mysql-trunk-bugfixing/
> based on revid:alik@stripped
> 
>  3015 Alfranio Correia	2010-04-23
>       BUG#53075 SBR: Strange warning around CONNECTION_ID
>       
>       Statements with CONNECTION_ID were forced to be kept in the transactional
>       cache and by consequence non-transactional changes that were supposed to
>       be flushed ahead of the transaction were kept in the transactional cache.
>       
>       This happened because after BUG#51894 any statement whose thd's
>       thread_specific_used was set was kept in the transactional cache. The idea
>       was to keep changes on temporary tables in the transactional cache. However,
>       the thread_specific_used was set not only for statements that accessed
>       temporary tables but also when the CONNECTION_ID was used.
>       
>       To fix the problem, we created a new variable to keep track of updates
>       to temporary tables.
>      @ sql/log_event.cc
>         Uses the thread_temporary_used to decide if a statement should
>         be kept in the transactional cache or not.
>      @ sql/sql_class.cc
>         Sets the thread_temporary_used while calling the decide_logging_format.
>      @ sql/sql_class.h
>         Defines the thread_temporary_used.
>      @ sql/sql_parse.cc
>         Resets the thread_temporary_used.
> 
>     modified:
>       sql/log_event.cc
>       sql/sql_class.cc
>       sql/sql_class.h
>       sql/sql_parse.cc
> === modified file 'sql/log_event.cc'
> --- a/sql/log_event.cc	2010-04-20 09:10:43 +0000
> +++ b/sql/log_event.cc	2010-04-23 00:07:48 +0000
> @@ -679,7 +679,7 @@ Log_event::Log_event(THD* thd_arg, uint1
>    server_id=	thd->server_id;
>    when=		thd->start_time;
>    cache_type= (using_trans || stmt_has_updated_trans_table(thd)
> -               || thd->thread_specific_used
> +               || thd->thread_temporary_used
>                 ? Log_event::EVENT_TRANSACTIONAL_CACHE :
>                 Log_event::EVENT_STMT_CACHE);
>  }
> @@ -2553,7 +2553,7 @@ Query_log_event::Query_log_event(THD* th
>    else
>    {
>      cache_type= ((using_trans || stmt_has_updated_trans_table(thd) ||
> -                 force_trans || thd->thread_specific_used)
> +                 force_trans || thd->thread_temporary_used)
>                   ? Log_event::EVENT_TRANSACTIONAL_CACHE :
>                   Log_event::EVENT_STMT_CACHE);
>    }
> 
> === modified file 'sql/sql_class.cc'
> --- a/sql/sql_class.cc	2010-04-20 09:10:43 +0000
> +++ b/sql/sql_class.cc	2010-04-23 00:07:48 +0000
> @@ -3736,6 +3736,7 @@ int THD::decide_logging_format(TABLE_LIS
>          trans_non_trans_access_engines= (prev_trans != act_trans);
>          multi_access_engine= TRUE;
>        }
> +      thread_temporary_used |= table->table->s->tmp_table;
>        prev_access_table= table->table;
>      }
>  
> 
> === modified file 'sql/sql_class.h'
> --- a/sql/sql_class.h	2010-04-20 09:10:43 +0000
> +++ b/sql/sql_class.h	2010-04-23 00:07:48 +0000
> @@ -2107,7 +2107,7 @@ public:
>    bool       bootstrap, cleanup_done;
>    
>    /**  is set if some thread specific value(s) used in a statement. */
> -  bool       thread_specific_used;
> +  bool       thread_specific_used, thread_temporary_used;
>    bool	     charset_is_system_charset, charset_is_collation_connection;
>    bool       charset_is_character_set_filesystem;
>    bool       enable_slow_log;   /* enable slow log for current statement */
> 
> === modified file 'sql/sql_parse.cc'
> --- a/sql/sql_parse.cc	2010-04-20 08:51:50 +0000
> +++ b/sql/sql_parse.cc	2010-04-23 00:07:48 +0000
> @@ -5530,7 +5530,7 @@ void THD::reset_for_next_command()
>      thd->transaction.all.modified_non_trans_table= FALSE;
>    }
>    DBUG_ASSERT(thd->security_ctx== &thd->main_security_ctx);
> -  thd->thread_specific_used= FALSE;
> +  thd->thread_specific_used= thd->thread_temporary_used= FALSE;
>  
>    if (opt_bin_log)
>    {
> 


Thread
bzr commit into mysql-trunk-bugfixing branch (alfranio.correia:3015)Bug#53075Alfranio Correia23 Apr
  • Re: bzr commit into mysql-trunk-bugfixing branch(alfranio.correia:3015) Bug#53075He Zhenxing23 Apr
    • Re: bzr commit into mysql-trunk-bugfixing branch(alfranio.correia:3015) Bug#53075Alfranio Correia23 Apr