List:Commits« Previous MessageNext Message »
From:sanja Date:August 18 2008 7:58pm
Subject:bzr commit into mysql-6.0-backup branch (sanja:2684) Bug#38492
View as plain text  
#At file:///home/bell/mysql/bzr/work-maria6.0-38492/

 2684 sanja@stripped	2008-08-18
      Ignore OK "sent" to user if it is connection termination (BUG#38492).
modified:
  mysql-test/mysql-test-run.pl*
  mysql-test/r/maria.result
  mysql-test/t/maria.test
  sql/sql_class.cc
  sql/sql_class.h
  sql/sql_parse.cc
  storage/maria/ha_maria.cc

per-file messages:
  mysql-test/mysql-test-run.pl
    This script made executable again.
  mysql-test/r/maria.result
    test suite for BUG#38492
  mysql-test/t/maria.test
    test suite for BUG#38492
  sql/sql_class.cc
    Connection termination flag added.
  sql/sql_class.h
    Connection termination flag added.
  sql/sql_parse.cc
    Connection termination flag added.
  storage/maria/ha_maria.cc
    gnore OK "sent" to user if it is connection termination.
=== modified file 'mysql-test/mysql-test-run.pl' (properties changed: -x to +x)
=== modified file 'mysql-test/r/maria.result'
--- a/mysql-test/r/maria.result	2008-07-10 15:20:07 +0000
+++ b/mysql-test/r/maria.result	2008-08-18 17:58:00 +0000
@@ -1901,3 +1901,9 @@ check table t2 extended;
 Table	Op	Msg_type	Msg_text
 test.t2	check	status	OK
 drop table t2;
+create table t1 (a int, b int) engine=maria transactional=1;
+insert t1 values (1,2);
+insert t1 values (2,3), (sleep(10),sleep(20)), (4,5);;
+LOCK TABLES t1 write concurrent;
+insert t1 values (7,8);
+drop table t1;

=== modified file 'mysql-test/t/maria.test'
--- a/mysql-test/t/maria.test	2008-07-10 15:20:07 +0000
+++ b/mysql-test/t/maria.test	2008-08-18 17:58:00 +0000
@@ -1188,6 +1188,21 @@ insert into t2 values (repeat('x',28)), 
 check table t2 extended;
 drop table t2;
 
+#
+# BUG#38492 test suite
+#
+create table t1 (a int, b int) engine=maria transactional=1;
+insert t1 values (1,2);
+--send insert t1 values (2,3), (sleep(10),sleep(20)), (4,5);
+connect (root2,localhost,root,,test);
+--connection root2
+LOCK TABLES t1 write concurrent;
+insert t1 values (7,8);
+-- disconnect root2
+connection default;
+--reap
+drop table t1;
+
 --disable_result_log
 --disable_query_log
 eval set global storage_engine=$default_engine, maria_page_checksum=$default_checksum;

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2008-07-20 22:39:29 +0000
+++ b/sql/sql_class.cc	2008-08-18 17:58:00 +0000
@@ -391,6 +391,7 @@ Diagnostics_area::reset_diagnostics_area
   m_total_warn_count= 0;
 #endif
   is_sent= FALSE;
+  is_quit= FALSE;
   /** Tiny reset in debug mode to see garbage right away */
   m_status= DA_EMPTY;
   DBUG_VOID_RETURN;

=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h	2008-07-14 22:06:19 +0000
+++ b/sql/sql_class.h	2008-08-18 17:58:00 +0000
@@ -1141,6 +1141,8 @@ public:
   };
   /** True if status information is sent to the client. */
   bool is_sent;
+  /** True if connection is closed */
+  bool is_quit;
   /** Set to make set_error_status after set_{ok,eof}_status possible. */
   bool can_overwrite_status;
 

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2008-07-20 22:39:29 +0000
+++ b/sql/sql_parse.cc	2008-08-18 17:58:00 +0000
@@ -1172,6 +1172,7 @@ bool dispatch_command(enum enum_server_c
     general_log_print(thd, command, NullS);
     net->error=0;				// Don't give 'abort' message
     thd->main_da.disable_status();              // Don't send anything back
+    thd->main_da.is_quit= TRUE;                 // Connection is closed
     error=TRUE;					// End server
     break;
 
@@ -1246,6 +1247,7 @@ bool dispatch_command(enum enum_server_c
                       (long) pos);
       mysql_binlog_send(thd, thd->strdup(packet + 10), (my_off_t) pos, flags);
       unregister_slave(thd,1,1);
+      thd->main_da.is_quit= TRUE;                 // Connection is closed
       /*  fake COM_QUIT -- if we get here, the thread needs to terminate */
       error = TRUE;
       break;
@@ -1289,6 +1291,7 @@ bool dispatch_command(enum enum_server_c
     my_eof(thd);
     close_thread_tables(thd);			// Free before kill
     kill_mysql();
+    thd->main_da.is_quit= TRUE;                 // Connection is closed
     error=TRUE;
     break;
   }

=== modified file 'storage/maria/ha_maria.cc'
--- a/storage/maria/ha_maria.cc	2008-07-10 14:58:31 +0000
+++ b/storage/maria/ha_maria.cc	2008-08-18 17:58:00 +0000
@@ -2229,11 +2229,12 @@ int ha_maria::external_lock(THD *thd, in
         if (!trnman_decrement_locked_tables(trn))
         {
           /*
-            OK should not have been sent to client yet (ACID).
+            OK should not have been sent to client yet (ACID),
+            exception: connection is closed by client.
             This is a bit excessive, ACID requires this only if there are some
             changes to commit (rollback shouldn't be tested).
           */
-          DBUG_ASSERT(!thd->main_da.is_sent);
+          DBUG_ASSERT(!thd->main_da.is_sent || thd->main_da.is_quit);
           /* autocommit ? rollback a transaction */
 #ifdef MARIA_CANNOT_ROLLBACK
           if (ma_commit(trn))

Thread
bzr commit into mysql-6.0-backup branch (sanja:2684) Bug#38492sanja18 Aug