From 21f878e7243346efa9e8ae41400528a8d5cb76cb Mon Sep 17 00:00:00 2001 From: Matthias Leich Date: Fri, 15 May 2009 12:15:56 +0200 Subject: Fix for Bug#42308 Several server tests do not pass MTR's --check option Details: Most tests mentioned within the bug report were already fixed. The test modified here failed in stability (high parallel load) tests. Details: 1. Take care that disconnects are finished before the test terminates. 2. Correct wrong handling of send/reap in events_stress which caused random garbled output 3. Minor beautifying of script code --- mysql-test/t/func_compress.test | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test/t/func_compress.test') diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index 0a3a3823fee..4c5121da345 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -50,6 +50,7 @@ set @@global.max_allowed_packet=1048576*100; --connect (newconn, localhost, root,,) eval select compress(repeat('aaaaaaaaaa', IF('$LOW_MEMORY', 10, 10000000))) is null; disconnect newconn; +--source include/wait_until_disconnected.inc connection default; set @@global.max_allowed_packet=default; -- cgit v1.2.1 From 0b62b7f26d2bef58983f7c7e8b288dd9bce0cdcc Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Wed, 20 May 2009 12:30:06 +0400 Subject: Bug #44796: valgrind: too many my_longlong10_to_str_8bit warnings after uncompressed_length UNCOMPRESSED_LENGTH() did not validate its argument. In particular, if the argument length was less than 4 bytes, an uninitialized memory value was returned as a result. Since the result of COMPRESS() is either an empty string or a 4-byte length prefix followed by compressed data, the bug was fixed by ensuring that the argument of UNCOMPRESSED_LENGTH() is either an empty string or contains at least 5 bytes (as done in UNCOMPRESS()). This is the best we can do to validate input without decompressing. mysql-test/r/func_compress.result: Added a test case for bug #44796. mysql-test/t/func_compress.test: Added a test case for bug #44796. sql/item_strfunc.cc: Make sure that the argument of UNCOMPRESSED_LENGTH() contains at least 5 bytes (as done in UNCOMPRESS()). --- mysql-test/t/func_compress.test | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mysql-test/t/func_compress.test') diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index 68f07f258bf..b1a37c16c6d 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -82,4 +82,21 @@ select *, uncompress(a) from t1; select *, uncompress(a), uncompress(a) is null from t1; drop table t1; +# +# Bug #44796: valgrind: too many my_longlong10_to_str_8bit warnings after +# uncompressed_length +# + +CREATE TABLE t1 (c1 INT); +INSERT INTO t1 VALUES (1), (1111), (11111); + +SELECT UNCOMPRESS(c1), UNCOMPRESSED_LENGTH(c1) FROM t1; + +# We do not need the results, just make sure there are no valgrind errors +--disable_result_log +EXPLAIN EXTENDED SELECT * FROM (SELECT UNCOMPRESSED_LENGTH(c1) FROM t1) AS s; +--enable_result_log + +DROP TABLE t1; + --echo End of 5.0 tests -- cgit v1.2.1 From 2cd3eaf27d461d4563d7f1719a022b8d55d67849 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Thu, 21 May 2009 19:14:56 +0400 Subject: Fixed a PB failure introduced by the patch for bug #44796. Set max_allowed_packet to get a consistent error message. --- mysql-test/t/func_compress.test | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mysql-test/t/func_compress.test') diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index b1a37c16c6d..8df26dce2ee 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -87,6 +87,9 @@ drop table t1; # uncompressed_length # +SET @old_max_allowed_packet = @@max_allowed_packet; +SET @@max_allowed_packet = 1024 * 1024; + CREATE TABLE t1 (c1 INT); INSERT INTO t1 VALUES (1), (1111), (11111); @@ -97,6 +100,8 @@ SELECT UNCOMPRESS(c1), UNCOMPRESSED_LENGTH(c1) FROM t1; EXPLAIN EXTENDED SELECT * FROM (SELECT UNCOMPRESSED_LENGTH(c1) FROM t1) AS s; --enable_result_log +SET @@max_allowed_packet = @old_max_allowed_packet; + DROP TABLE t1; --echo End of 5.0 tests -- cgit v1.2.1 From 82c878f913daacb7d047efea172e0b3fa491e122 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Thu, 21 May 2009 21:50:17 +0400 Subject: Attempt #2 to fix PB failures introduced by the patch for bug #44796. Since max_allowed_packet is a read-only variable in 5.1 and up, disable warnings to avoid unnecessary test case complication. --- mysql-test/t/func_compress.test | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'mysql-test/t/func_compress.test') diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index 8df26dce2ee..c84f22c5595 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -87,21 +87,19 @@ drop table t1; # uncompressed_length # -SET @old_max_allowed_packet = @@max_allowed_packet; -SET @@max_allowed_packet = 1024 * 1024; - CREATE TABLE t1 (c1 INT); INSERT INTO t1 VALUES (1), (1111), (11111); +# Disable warnings to avoid dependency on max_allowed_packet value +--disable_warnings SELECT UNCOMPRESS(c1), UNCOMPRESSED_LENGTH(c1) FROM t1; +--enable_warnings # We do not need the results, just make sure there are no valgrind errors --disable_result_log EXPLAIN EXTENDED SELECT * FROM (SELECT UNCOMPRESSED_LENGTH(c1) FROM t1) AS s; --enable_result_log -SET @@max_allowed_packet = @old_max_allowed_packet; - DROP TABLE t1; --echo End of 5.0 tests -- cgit v1.2.1