List:Commits« Previous MessageNext Message »
From:Marc Alff Date:November 2 2011 6:12pm
Subject:bzr push into mysql-trunk branch (marc.alff:3546 to 3547) Bug#12981100
View as plain text  
 3547 Marc Alff	2011-11-02
      Bug#12981100 PERFORMANCE_SCHEMA NET IO IDLE AND RECV EVENTS NEST WITHIN THE WRONG STATEMENT
      
      Post push cleanup, to fix a remaining assert.
      
      Instrument incomplete statements as "statement/com/error",
      when a full network packet can not be read.

    modified:
      sql/sql_parse.cc
 3546 Marc Alff	2011-11-02
      bug#12981100, post fix cleanup

    modified:
      mysql-test/r/mysqld--help-notwin.result
      mysql-test/r/mysqld--help-win.result
      mysql-test/suite/perfschema/r/nesting.result
      mysql-test/suite/perfschema/t/nesting.test
      sql/sql_parse.cc
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2011-11-02 16:07:18 +0000
+++ b/sql/sql_parse.cc	2011-11-02 18:11:26 +0000
@@ -854,12 +854,20 @@ bool do_command(THD *thd)
 		       net->error,
 		       vio_description(net->vio)));
 
+    /* Instrument this broken statement as "statement/com/error" */
+    thd->m_statement_psi= MYSQL_REFINE_STATEMENT(thd->m_statement_psi,
+                                                 com_statement_info[COM_END].m_key);
+
     /* Check if we can continue without closing the connection */
 
     /* The error must be set. */
     DBUG_ASSERT(thd->is_error());
     thd->protocol->end_statement();
 
+    /* Mark the statement completed. */
+    MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
+    thd->m_statement_psi= NULL;
+
     if (net->error != 3)
     {
       return_value= TRUE;                       // We have to close it.
@@ -906,7 +914,7 @@ bool do_command(THD *thd)
   return_value= dispatch_command(command, thd, packet+1, (uint) (packet_length-1));
 
 out:
-  /* The statement instrumentation is closed in dispatch_command() */
+  /* The statement instrumentation must be closed in all cases. */
   DBUG_ASSERT(thd->m_statement_psi == NULL);
   DBUG_RETURN(return_value);
 }
@@ -1207,6 +1215,7 @@ bool dispatch_command(enum enum_server_c
 
 /* PSI end */
       MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
+      thd->m_statement_psi= NULL;
 
 /* DTRACE end */
       if (MYSQL_QUERY_DONE_ENABLED())

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (marc.alff:3546 to 3547) Bug#12981100Marc Alff7 Nov