summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2009-03-26 20:17:27 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2009-03-26 20:17:27 -0300
commit96e02e57166a37f79c10f5f9afc1f9185e1110a7 (patch)
tree5c1613304d29947b6024b159a6d7ca222b80c3c8 /mysql-test
parent4ee0f6a64c89f226a113688ab6f894f9e18ffa74 (diff)
downloadmariadb-git-96e02e57166a37f79c10f5f9afc1f9185e1110a7.tar.gz
Bug#33899: Deadlock in mysql_real_query with shared memory connections
The problem is that the read and write methods of the shared memory transport (protocol) didn't react to asynchronous close events, which could lead to a lock up as the client would wait (until time out) for a server response that will never come. The solution is to also wait for close events while waiting for I/O from or to the server. mysql-test/r/shm.result: Add test case result for Bug#33899 mysql-test/t/shm.test: Add test case for Bug#33899 vio/viosocket.c: Also wait for close events.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/shm.result7
-rw-r--r--mysql-test/t/shm.test19
2 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/r/shm.result b/mysql-test/r/shm.result
index 09adebad10f..9d555e9878c 100644
--- a/mysql-test/r/shm.result
+++ b/mysql-test/r/shm.result
@@ -2152,4 +2152,11 @@ Warnings:
Warning 1052 Column 'kundentyp' in group statement is ambiguous
drop table t1;
mysqld is alive
+SET @max_allowed_packet= @@global.max_allowed_packet;
+SET @net_buffer_length= @@global.net_buffer_length;
+SET GLOBAL max_allowed_packet= 1024;
+SET GLOBAL net_buffer_length= 1024;
+ERROR 1153 (08S01) at line 1: Got a packet bigger than 'max_allowed_packet' bytes
+SET GLOBAL max_allowed_packet= @max_allowed_packet;
+SET GLOBAL net_buffer_length= @net_buffer_length;
End of 5.0 tests.
diff --git a/mysql-test/t/shm.test b/mysql-test/t/shm.test
index 380607d8ebf..88e96ae7b45 100644
--- a/mysql-test/t/shm.test
+++ b/mysql-test/t/shm.test
@@ -16,4 +16,23 @@ if (`SELECT '$shm' != 'ON'`){
#
--exec $MYSQLADMIN --no-defaults --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ping
+#
+# Bug #33899: Deadlock in mysql_real_query with shared memory connections
+#
+
+let $name= query_get_value("SHOW GLOBAL VARIABLES LIKE 'shared_memory_base_name'", Value, 1);
+let $stmt= `SELECT REPEAT('a', 2048)`;
+
+SET @max_allowed_packet= @@global.max_allowed_packet;
+SET @net_buffer_length= @@global.net_buffer_length;
+
+SET GLOBAL max_allowed_packet= 1024;
+SET GLOBAL net_buffer_length= 1024;
+
+--error 1
+--exec echo SELECT '$stmt'| $MYSQL --protocol=memory --shared-memory-base-name=$name 2>&1
+
+SET GLOBAL max_allowed_packet= @max_allowed_packet;
+SET GLOBAL net_buffer_length= @net_buffer_length;
+
--echo End of 5.0 tests.