List:Commits« Previous MessageNext Message »
From:konstantin Date:October 26 2007 11:54am
Subject:bk commit into 5.1 tree (kostja:1.2599)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of kostja. When kostja does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-10-26 15:54:42+04:00, kostja@bodhi.(none) +1 -0
  Fix failing init_connect.test (5.1-runtime). Add comments for the unjustified use
  of thd->is_slave_error.

  sql/sql_connect.cc@stripped, 2007-10-26 15:54:40+04:00, kostja@bodhi.(none) +11 -1
    Fix failing init_connect.test. Add comments for the unjustified use
    of thd->is_slave_error.

diff -Nrup a/sql/sql_connect.cc b/sql/sql_connect.cc
--- a/sql/sql_connect.cc	2007-10-20 01:20:35 +04:00
+++ b/sql/sql_connect.cc	2007-10-26 15:54:40 +04:00
@@ -1030,7 +1030,17 @@ static void prepare_new_connection_state
   if (sys_init_connect.value_length && !(sctx->master_access & SUPER_ACL))
   {
     execute_init_command(thd, &sys_init_connect, &LOCK_sys_init_connect);
-    if (thd->net.report_error)
+    /*
+      execute_init_command calls net_send_error.
+      If there was an error during execution of the init statements, 
+      the error at this moment is present in thd->net.last_error and also
+      thd->is_slave_error and thd->net.report_error are set.
+      net_send_error sends the contents of thd->net.last_error and
+      clears thd->net.report_error. It doesn't, however, clean
+      thd->is_slave_error or thd->net.last_error. Here we make use of this
+      fact.
+    */
+    if (thd->is_slave_error)
     {
       thd->killed= THD::KILL_CONNECTION;
       sql_print_warning(ER(ER_NEW_ABORTING_CONNECTION),
Thread
bk commit into 5.1 tree (kostja:1.2599)konstantin26 Oct