#At file:///home/bell/mysql/bzr/work-maria6.0/
2689 sanja@stripped 2008-08-20
Ignore OK "sent" to user if it is connection termination (BUG#38492).
modified:
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/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
Ignore OK "sent" to user if it is connection termination.
=== modified file 'mysql-test/r/maria.result'
--- a/mysql-test/r/maria.result 2008-08-16 12:27:06 +0000
+++ b/mysql-test/r/maria.result 2008-08-20 15:02:09 +0000
@@ -2223,3 +2223,9 @@ b
12345
12345
drop table t1;
+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-08-16 12:27:06 +0000
+++ b/mysql-test/t/maria.test 2008-08-20 15:02:09 +0000
@@ -1500,6 +1500,21 @@ insert t1 (a) values (repeat('1', 200)),
select b from t1 where a >= repeat('f', 200) and a < 'k';
drop table t1;
+#
+# 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-25 17:21:55 +0000
+++ b/sql/sql_class.cc 2008-08-20 15:02:09 +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-26 16:38:20 +0000
+++ b/sql/sql_class.h 2008-08-20 15:02:09 +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-08-08 13:34:35 +0000
+++ b/sql/sql_parse.cc 2008-08-20 15:02:09 +0000
@@ -1242,6 +1242,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;
@@ -1316,6 +1317,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;
@@ -1364,6 +1366,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-08-12 10:59:30 +0000
+++ b/storage/maria/ha_maria.cc 2008-08-20 15:02:09 +0000
@@ -2231,11 +2231,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 branch (sanja:2689) Bug#38492 | sanja | 20 Aug |