MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:November 16 2010 9:57pm
Subject:bzr commit into mysql-5.5-runtime branch (davi:3187) Bug#57058
View as plain text  
# At a local mysql-5.5-runtime repository of davi

 3187 Davi Arnaut	2010-11-16
      Bug#57058: SERVER_QUERY_WAS_SLOW not wired up.
      
      Finalize the server flags after any kind of command is executed.
      To avoid updating the flag multiple times, reorganize code so that
      its invoked only once for each command.
     @ sql/log_event.cc
        Explicit update after the query is executed in the slave.
     @ sql/sql_parse.cc
        Reorganize so that the status flag is updated for any command and
        not done twice for a query command.

    modified:
      sql/log_event.cc
      sql/sql_parse.cc
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2010-11-11 17:11:05 +0000
+++ b/sql/log_event.cc	2010-11-16 21:57:18 +0000
@@ -3353,6 +3353,8 @@ int Query_log_event::do_apply_event(Rela
       if (!parser_state.init(thd, thd->query(), thd->query_length()))
       {
         mysql_parse(thd, thd->query(), thd->query_length(), &parser_state);
+        /* Finalize server status flags after executing a statement. */
+        thd->update_server_status();
         log_slow_statement(thd);
       }
 

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2010-11-12 12:56:21 +0000
+++ b/sql/sql_parse.cc	2010-11-16 21:57:18 +0000
@@ -1034,11 +1034,13 @@ bool dispatch_command(enum enum_server_c
     while (!thd->killed && (parser_state.m_lip.found_semicolon != NULL) &&
            ! thd->is_error())
     {
-      char *beginning_of_next_stmt= (char*)
-        parser_state.m_lip.found_semicolon;
       /*
         Multiple queries exits, execute them individually
       */
+      char *beginning_of_next_stmt= (char*) parser_state.m_lip.found_semicolon;
+
+      /* Finalize server status flags after executing a statement. */
+      thd->update_server_status();
       thd->protocol->end_statement();
       query_cache_end_of_result(thd);
       ulong length= (ulong)(packet_end - beginning_of_next_stmt);
@@ -1384,6 +1386,8 @@ bool dispatch_command(enum enum_server_c
               (thd->open_tables == NULL ||
                (thd->locked_tables_mode == LTM_LOCK_TABLES)));
 
+  /* Finalize server status flags after executing a command. */
+  thd->update_server_status();
   thd->protocol->end_statement();
   query_cache_end_of_result(thd);
 
@@ -5504,8 +5508,6 @@ void mysql_parse(THD *thd, char *rawbuf,
     thd->end_statement();
     thd->cleanup_after_query();
     DBUG_ASSERT(thd->change_list.is_empty());
-    /* Finalize server status flags after executing a statement. */
-    thd->update_server_status();
   }
 
   DBUG_VOID_RETURN;


Attachment: [text/bzr-bundle] bzr/davi.arnaut@oracle.com-20101116215718-grx7tmyrcd0htca2.bundle
Thread
bzr commit into mysql-5.5-runtime branch (davi:3187) Bug#57058Davi Arnaut16 Nov
Re: bzr commit into mysql-5.5-runtime branch (davi:3187) Bug#57058Jon Olav Hauglid17 Nov