List:Commits« Previous MessageNext Message »
From:Konstantin Osipov Date:July 15 2009 12:17pm
Subject:bzr commit into mysql-5.1-bugteam branch (kostja:3017) Bug#44521
View as plain text  
#At file:///opt/local/work/5.1-bugteam/ based on revid:staale.smedseng@stripped

 3017 Konstantin Osipov	2009-07-15
      A fix for Bug#44521 "Prepared Statement: CALL p() - crashes: `! thd->main_da.is_sent' 
      failed et.al."
      
      The bug was fixed 1 year ago in WL#2983 tree.

    modified:
      sql/protocol.cc
      sql/sql_class.cc
=== modified file 'sql/protocol.cc'
--- a/sql/protocol.cc	2009-03-24 13:58:52 +0000
+++ b/sql/protocol.cc	2009-07-15 12:17:55 +0000
@@ -388,6 +388,7 @@ void net_end_statement(THD *thd)
   /* Can not be true, but do not take chances in production. */
   if (thd->main_da.is_sent)
     return;
+  thd->main_da.is_sent= TRUE;
 
   switch (thd->main_da.status()) {
   case Diagnostics_area::DA_ERROR:
@@ -418,7 +419,6 @@ void net_end_statement(THD *thd)
                 0, 0, NULL);
     break;
   }
-  thd->main_da.is_sent= TRUE;
 }
 
 

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2009-06-27 13:18:47 +0000
+++ b/sql/sql_class.cc	2009-07-15 12:17:55 +0000
@@ -513,6 +513,15 @@ Diagnostics_area::set_error_status(THD *
   m_sql_errno= sql_errno_arg;
   strmake(m_message, message_arg, sizeof(m_message) - 1);
 
+  /*
+    If we're overwriting the status, unset the 'is_sent' flag,
+    since effectively we get a new message into the DA
+    on top of the one that is being sent. This can happen
+    when we're inside net_end_statement().
+  */
+  if (is_set() && is_sent)
+    is_sent= FALSE;
+
   m_status= DA_ERROR;
 }
 


Attachment: [text/bzr-bundle] bzr/kostja@sun.com-20090715121755-43fg1n98xsw3cc71.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (kostja:3017) Bug#44521Konstantin Osipov15 Jul