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/r/func_compress.result | 5 ++++- mysql-test/t/func_compress.test | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index a30ca7859f1..af3c5905678 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -116,6 +116,8 @@ Warnings: Error 1259 ZLIB: Input data corrupted Error 1259 ZLIB: Input data corrupted drop table t1; +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); SELECT UNCOMPRESS(c1), UNCOMPRESSED_LENGTH(c1) FROM t1; @@ -128,7 +130,8 @@ Error 1259 ZLIB: Input data corrupted Error 1259 ZLIB: Input data corrupted Error 1259 ZLIB: Input data corrupted Error 1259 ZLIB: Input data corrupted -Error 1256 Uncompressed data size too large; the maximum size is 104857600 (probably, length of uncompressed data was corrupted) +Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted) EXPLAIN EXTENDED SELECT * FROM (SELECT UNCOMPRESSED_LENGTH(c1) FROM t1) AS s; +SET @@max_allowed_packet = @old_max_allowed_packet; DROP TABLE t1; End of 5.0 tests 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/r/func_compress.result | 9 --------- mysql-test/t/func_compress.test | 8 +++----- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index af3c5905678..d8745c38f57 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -116,8 +116,6 @@ Warnings: Error 1259 ZLIB: Input data corrupted Error 1259 ZLIB: Input data corrupted drop table t1; -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); SELECT UNCOMPRESS(c1), UNCOMPRESSED_LENGTH(c1) FROM t1; @@ -125,13 +123,6 @@ UNCOMPRESS(c1) UNCOMPRESSED_LENGTH(c1) NULL NULL NULL NULL NULL 825307441 -Warnings: -Error 1259 ZLIB: Input data corrupted -Error 1259 ZLIB: Input data corrupted -Error 1259 ZLIB: Input data corrupted -Error 1259 ZLIB: Input data corrupted -Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted) EXPLAIN EXTENDED SELECT * FROM (SELECT UNCOMPRESSED_LENGTH(c1) FROM t1) AS s; -SET @@max_allowed_packet = @old_max_allowed_packet; DROP TABLE t1; End of 5.0 tests 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