From dcf6b68d08acfbfdc3183b0a13f041af51573eb1 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 25 Mar 2011 12:57:27 +0200 Subject: Bug #11766769: 59959: SMALL VALUES OF --MAX-ALLOWED-PACKET ARE NOT BEING HONORED max_allowed_packet works in conjunction with net_buffer_length. max_allowed_packet is an upper bound of net_buffer_length. So it doesn't make sense to set the upper limit lower than the value. Added a warning (using ER_UNKNOWN_ERRROR and a specific message) when this is done (in the log at startup and when setting either max_allowed_packet or the net_buffer_length variables) Added a test case. Fixed several tests that broke the above rule. --- mysql-test/t/variables.test | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index c61e2aa3708..383bdfc79a9 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1304,4 +1304,30 @@ SET @@global.max_join_size=DEFAULT; SET @@global.key_buffer_size=@kbs; SET @@global.key_cache_block_size=@kcbs; + +--echo # +--echo # Bug #11766769 : 59959: SMALL VALUES OF --MAX-ALLOWED-PACKET +--echo # ARE NOT BEING HONORED +--echo # + +CREATE TABLE t1 (a MEDIUMTEXT); + +SET GLOBAL max_allowed_packet=2048; +SET GLOBAL net_buffer_length=4096; +CONNECT (con1,localhost,root,,test); +SHOW SESSION VARIABLES LIKE 'max_allowed_packet'; +SHOW SESSION VARIABLES LIKE 'net_buffer_length'; +--disable_query_log +--error ER_NET_PACKET_TOO_LARGE +INSERT INTO t1 VALUES ('123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); +--enable_query_log +SELECT LENGTH(a) FROM t1; + +CONNECTION default; +DISCONNECT con1; +SET GLOBAL max_allowed_packet=default; +SET GLOBAL net_buffer_length=default; +DROP TABLE t1; + + --echo End of 5.1 tests -- cgit v1.2.1 From f1b638d33cdf95b70fa925cce304864c96fdf7ee Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Fri, 25 Mar 2011 15:16:13 +0100 Subject: BUG#11766427, BUG#59539: Filter by server id in mysqlbinlog fails Problem: mysqlbinlog --server-id may filter out Format_description_log_events. If mysqlbinlog does not process the Format_description_log_event, then mysqlbinlog cannot read the rest of the binary log correctly. This can have the effect that mysqlbinlog crashes, generates an error, or generates output that causes mysqld to crash, generate an error, or corrupt data. Fix: Never filter out Format_description_log_events. Also, never filter out Rotate_log_events. client/mysqlbinlog.cc: Process Format_description_log_events even when the server_id does not match the number given by --server-id. mysql-test/t/mysqlbinlog.test: Add test case. --- mysql-test/t/mysqlbinlog.test | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index d5dd3052269..98ee18b554e 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -501,3 +501,23 @@ exec $MYSQL_BINLOG $MYSQLD_DATADIR/$master_binlog | $MYSQL test 2>&1; let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1); source include/show_binlog_events.inc; +# +# BUG#11766427 BUG#59530: Filter by server id in mysqlbinlog fails +# This test checks that the format description log event is not +# filtered out by the --server-id option. +# +RESET MASTER; +USE test; +CREATE TABLE t1 (a INT); +--let $old_server_id= `SELECT @@GLOBAL.SERVER_ID` +SET GLOBAL SERVER_ID = 2; +DROP TABLE t1; +--let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1) +FLUSH LOGS; +# The following should only create t1, not drop it. +--exec $MYSQL_BINLOG --server-id=1 $MYSQLD_DATADIR/$master_binlog | $MYSQL +SHOW TABLES IN test; +# The following should only drop t1, not create it. +--exec $MYSQL_BINLOG --server-id=2 $MYSQLD_DATADIR/$master_binlog | $MYSQL +SHOW TABLES IN test; +eval SET GLOBAL SERVER_ID = $old_server_id; -- cgit v1.2.1 From d499851be03a2a20f7cb230d9b2d69e169aa81c8 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Mon, 28 Mar 2011 11:53:18 +0400 Subject: Bug#11766112 59151:UNINITIALIZED VALUES IN EXTRACT_DATE_TIME WITH STR_TO_DATE(SPACE(..) ... Valgrind warining happens due to missing 'end of the string' check. The fix is to check if we reached the end of the string. mysql-test/r/func_time.result: test case mysql-test/t/func_time.test: test case sql/item_timefunc.cc: check if we reached the end of the string after leading spaces skipping. --- mysql-test/t/func_time.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index f32110ef87c..c48351d33f2 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -881,4 +881,10 @@ INSERT INTO t1 VALUES (''),(''); SELECT COUNT(*) FROM t1 GROUP BY TIME_TO_SEC(a); DROP TABLE t1; +--echo # +--echo # Bug#11766112 59151:UNINITIALIZED VALUES IN EXTRACT_DATE_TIME WITH STR_TO_DATE(SPACE(..) ... +--echo # + +SELECT STR_TO_DATE(SPACE(2),'1'); + --echo End of 5.1 tests -- cgit v1.2.1 From ff23f5360ee328bd6adb14436e68e080cfe1d110 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Mon, 28 Mar 2011 12:28:30 +0400 Subject: Bug#11766424 59527: DECIMAL_BIN_SIZE: ASSERTION `SCALE >= 0 && PRECISION > 0 && SCALE <= PRE Assertion happens due to missing initialization of unsigned_flag for Item_func_set_user_var object. It leads to incorrect calculation of decimal field size. The fix is to add initialization of unsigned_flag. mysql-test/r/variables.result: test case mysql-test/t/variables.test: test case sql/item_func.cc: add initialization of unsigned_flag. --- mysql-test/t/variables.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 383bdfc79a9..8f111e7cf3b 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1298,6 +1298,19 @@ SET @@global.key_cache_block_size=0; # select @@max_long_data_size; +--echo # +--echo # Bug#11766424 59527: DECIMAL_BIN_SIZE: ASSERTION `SCALE >= 0 && PRECISION > 0 && SCALE <= PRE +--echo # + +CREATE TABLE t1(f1 DECIMAL(1,1) UNSIGNED); +INSERT INTO t1 VALUES (0.2),(0.1); +SELECT 1 FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE @a=f1); +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT @a:= CAST(1 AS UNSIGNED) AS a; +SHOW CREATE TABLE t1; +DROP TABLE t1; + # cleanup SET @@global.max_binlog_cache_size=DEFAULT; SET @@global.max_join_size=DEFAULT; -- cgit v1.2.1 From a88faf2a4af5f60722647a8e01de6aac20305bb7 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Mon, 28 Mar 2011 12:35:50 +0400 Subject: Bug#11764994 57900: CREATE TABLE .. SELECT ASSERTS SCALE >= 0 && PRECISION > 0 && SCALE <= PR Assert fails due to overflow which happens in Item_func_int_val::fix_num_length_and_dec() as geometry functions have max_length value equal to max_field_size(4294967295U). The fix is to skip max_length calculation for some boundary cases. mysql-test/r/func_math.result: test case mysql-test/t/func_math.test: test case sql/item_func.cc: skip max_length calculation if argument max_length is near max_field_size. --- mysql-test/t/func_math.test | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index c8ea11c7490..64b6a3a4ea6 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -324,4 +324,13 @@ CREATE TABLE t1 SELECT CAST((CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1 SHOW CREATE TABLE t1; DROP TABLE t1; +--echo # +--echo # Bug#11764994 57900: CREATE TABLE .. SELECT ASSERTS SCALE >= 0 && PRECISION > 0 && SCALE <= PR +--echo # + +CREATE TABLE t1 SELECT CEIL(LINESTRINGFROMWKB(1) DIV NULL); +DROP TABLE t1; +CREATE TABLE t1 SELECT FLOOR(LINESTRINGFROMWKB(1) DIV NULL); +DROP TABLE t1; + --echo End of 5.1 tests -- cgit v1.2.1 From a3ab0d92defbafb462c7c5c50bab324521558971 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Mon, 28 Mar 2011 13:25:03 +0300 Subject: Fixed a test failure in embedded because of the fix for BUG#11766769 --- mysql-test/t/variables-notembedded.test | 27 +++++++++++++++++++++++++++ mysql-test/t/variables.test | 25 ------------------------- 2 files changed, 27 insertions(+), 25 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/variables-notembedded.test b/mysql-test/t/variables-notembedded.test index 7cc068c68c7..b440cfa47b0 100644 --- a/mysql-test/t/variables-notembedded.test +++ b/mysql-test/t/variables-notembedded.test @@ -109,3 +109,30 @@ SET @@session.slave_skip_errors= 7; --error ER_INCORRECT_GLOBAL_LOCAL_VAR SET @@global.slave_skip_errors= 7; # + +--echo # +--echo # Bug #11766769 : 59959: SMALL VALUES OF --MAX-ALLOWED-PACKET +--echo # ARE NOT BEING HONORED +--echo # + +CREATE TABLE t1 (a MEDIUMTEXT); + +SET GLOBAL max_allowed_packet=2048; +SET GLOBAL net_buffer_length=4096; +CONNECT (con1,localhost,root,,test); +SHOW SESSION VARIABLES LIKE 'max_allowed_packet'; +SHOW SESSION VARIABLES LIKE 'net_buffer_length'; +--disable_query_log +--error ER_NET_PACKET_TOO_LARGE +INSERT INTO t1 VALUES ('123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); +--enable_query_log + +CONNECTION default; +DISCONNECT con1; +SELECT LENGTH(a) FROM t1; + +SET GLOBAL max_allowed_packet=default; +SET GLOBAL net_buffer_length=default; +DROP TABLE t1; + +--echo End of 5.1 tests diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 8f111e7cf3b..d00b77e64c0 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1318,29 +1318,4 @@ SET @@global.key_buffer_size=@kbs; SET @@global.key_cache_block_size=@kcbs; ---echo # ---echo # Bug #11766769 : 59959: SMALL VALUES OF --MAX-ALLOWED-PACKET ---echo # ARE NOT BEING HONORED ---echo # - -CREATE TABLE t1 (a MEDIUMTEXT); - -SET GLOBAL max_allowed_packet=2048; -SET GLOBAL net_buffer_length=4096; -CONNECT (con1,localhost,root,,test); -SHOW SESSION VARIABLES LIKE 'max_allowed_packet'; -SHOW SESSION VARIABLES LIKE 'net_buffer_length'; ---disable_query_log ---error ER_NET_PACKET_TOO_LARGE -INSERT INTO t1 VALUES ('123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); ---enable_query_log -SELECT LENGTH(a) FROM t1; - -CONNECTION default; -DISCONNECT con1; -SET GLOBAL max_allowed_packet=default; -SET GLOBAL net_buffer_length=default; -DROP TABLE t1; - - --echo End of 5.1 tests -- cgit v1.2.1 From d6125b27b38432d1a465397c0c5a9e62bb1c65d3 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Mon, 28 Mar 2011 17:24:25 +0400 Subject: Bug#11765216 58154: UNINITIALIZED VARIABLE FORMAT IN STR_TO_DATE FUNCTION Valgrind warning happens due to uninitialized cached_format_type field which is used later in Item_func_str_to_date::val_str method. The fix is to init cached_format_type field. mysql-test/r/func_time.result: test case mysql-test/t/func_time.test: test case sql/item_timefunc.cc: init cached_format_type field --- mysql-test/t/func_time.test | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index c48351d33f2..3f441c42d48 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -887,4 +887,12 @@ DROP TABLE t1; SELECT STR_TO_DATE(SPACE(2),'1'); +--echo # +--echo # Bug#11765216 58154: UNINITIALIZED VARIABLE FORMAT IN STR_TO_DATE FUNCTION +--echo # + +SET GLOBAL SQL_MODE=''; +DO STR_TO_DATE((''), FROM_DAYS(@@GLOBAL.SQL_MODE)); +SET GLOBAL SQL_MODE=DEFAULT; + --echo End of 5.1 tests -- cgit v1.2.1 From 47885f552b1822291584b71c791fd5175ba6567f Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Mon, 28 Mar 2011 17:27:44 +0400 Subject: Bug#11766087 59125: VALGRIND UNINITIALISED VALUE WARNING IN ULL2DEC, LONGLONG2DECIMAL Valgrind warning happens due to missing NULL value check in Item_func::val_decimal. The fix is to add this check. mysql-test/r/func_time.result: test case mysql-test/t/func_time.test: test case sql/item_func.cc: added check for NULL value --- mysql-test/t/func_time.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 3f441c42d48..2c3d3849793 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -895,4 +895,10 @@ SET GLOBAL SQL_MODE=''; DO STR_TO_DATE((''), FROM_DAYS(@@GLOBAL.SQL_MODE)); SET GLOBAL SQL_MODE=DEFAULT; +--echo # +--echo # Bug#11766087 59125: VALGRIND UNINITIALISED VALUE WARNING IN ULL2DEC, LONGLONG2DECIMAL +--echo # + +SELECT FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1); + --echo End of 5.1 tests -- cgit v1.2.1 From 08e472ff349bb5d21b4881828ed62748ecf7aa40 Mon Sep 17 00:00:00 2001 From: Mayank Prasad Date: Mon, 28 Mar 2011 21:01:37 +0530 Subject: Bug#11751148 : show events shows events in other schema Issue: ====== Test case Correction for bug#11751148. mysql-test/r/events_bugs.result: Result file Correction for bug#11751148. mysql-test/t/events_bugs.test: Test case Correction for bug#11751148. --- mysql-test/t/events_bugs.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index 83e37cdccdb..420e7183621 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -1225,15 +1225,15 @@ SET GLOBAL server_id = @old_server_id; # Bug#11751148: show events shows events in other schema # +CREATE DATABASE event_test12; +USE event_test12; +CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; CREATE DATABASE event_test1; USE event_test1; -CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; -CREATE DATABASE event_test2; -USE event_test2; # Following show events should not show ev1 SHOW EVENTS; DROP DATABASE event_test1; -DROP DATABASE event_test2; +DROP DATABASE event_test12; ########################################################################### -- cgit v1.2.1 From 4e26a41f3e2cac5ec5016b862944c0116a18b0f6 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Tue, 29 Mar 2011 10:09:05 +0200 Subject: Bug# 11763784 (former 56541) ASSERTION TABLE->DB_STAT FAILED IN SQL_BASE.CC::OPEN_TABLE() DURING I_S Q This assert could be triggered if a statement requiring a name lock on a table (e.g. DROP TRIGGER) executed concurrently with an I_S query which also used the table. One connection first started an I_S query that opened a given table. Then another connection started a statement requiring a name lock on the same table. This statement was blocked since the table was in use by the I_S query. When the I_S query resumed and tried to open the table again as part of get_all_tables(), it would encounter a table instance with an old version number representing the pending name lock. Since I_S queries ignore version checks and thus pending name locks, it would try to continue. This caused it to encounter the assert. The assert checked that the TABLE instance found with a different version, was a real, open table. However, since this TABLE instance instead represented a pending name lock, the check would fail and trigger the assert. This patch fixes the problem by removing the assert. It is ok for TABLE::db_stat to be 0 in this case since the TABLE instance can represent a pending name lock. Test case added to lock_sync.test. --- mysql-test/t/lock_sync.test | 54 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/lock_sync.test b/mysql-test/t/lock_sync.test index 17f8abb75f3..1df09524140 100644 --- a/mysql-test/t/lock_sync.test +++ b/mysql-test/t/lock_sync.test @@ -862,6 +862,60 @@ disconnect con2; set @@global.concurrent_insert= @old_concurrent_insert; +--echo # +--echo # Bug#11763784 56541: ASSERTION TABLE->DB_STAT FAILED IN +--echo # SQL_BASE.CC::OPEN_TABLE() DURING I_S Q +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1(a int); +INSERT INTO t1 VALUES (1), (2); +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW BEGIN END; + +connect (con1, localhost, root); +--echo # Connection con2 +connect (con2, localhost, root); +SET DEBUG_SYNC= 'before_open_in_get_all_tables SIGNAL is_waits WAIT_FOR is_cont'; +--echo # Sending: +--send SELECT * FROM information_schema.table_constraints JOIN t1 ON table_name = a + +--echo # Connection con1 +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR is_waits'; +--echo # Sending: +--send DROP TRIGGER t1_bi + +--echo # Connection default +connection default; +--echo # Wait until DROP TRIGGER is blocked, waiting for t1 +let $wait_condition= + SELECT COUNT(*) = 1 FROM information_schema.processlist + WHERE state = "Waiting for table" AND + info = "DROP TRIGGER t1_bi"; +--source include/wait_condition.inc +SET DEBUG_SYNC= 'now SIGNAL is_cont'; + +--echo # Connection con2 +connection con2; +--echo # Reaping SELECT * FROM information_schema.table_constraints JOIN t1... +--reap + +--echo # Connection con1 +connection con1; +--echo # Reaping DROP TRIGGER t1_bi +--reap + +--echo # Connection default +connection default; +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; +disconnect con1; +disconnect con2; + + # Check that all connections opened by test cases in this file are really # gone so execution of other tests won't be affected by their presence. --source include/wait_until_count_sessions.inc -- cgit v1.2.1 From 3b7f044534ae24ce0a098d598bc7fc7a2b40fe4f Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Wed, 30 Mar 2011 11:00:41 +0400 Subject: Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNING Valgrind warning happens because null values check happens too late in Item_func_month::val_str(after result string calculation).The fix is to check null value before result string calculation. mysql-test/r/func_time.result: test case mysql-test/t/func_time.test: test case sql/item_timefunc.h: check null value before result string calculation. --- mysql-test/t/func_time.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 2c3d3849793..1bc56c0f403 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -901,4 +901,10 @@ SET GLOBAL SQL_MODE=DEFAULT; SELECT FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1); +--echo # +--echo # Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNING +--echo # + +SELECT CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025)); + --echo End of 5.1 tests -- cgit v1.2.1 From a7d383cbb8db5478c1c53a025afda967ad09299b Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Wed, 30 Mar 2011 11:08:35 +0400 Subject: Bug#11766124 59164: VALGRIND: UNINITIALIZED VALUE IN NUMBER_TO_DATETIME Valgrind warning happens due to missing NULL value check in Item::get_date. The fix is to add this check. mysql-test/r/func_time.result: test case mysql-test/t/func_time.test: test case sql/item.cc: added check for NULL value --- mysql-test/t/func_time.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 1bc56c0f403..938359f8c11 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -907,4 +907,10 @@ SELECT FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1); SELECT CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025)); +--echo # +--echo # Bug#11766124 59164: VALGRIND: UNINITIALIZED VALUE IN NUMBER_TO_DATETIME +--echo # + +SELECT ADDDATE(MONTH(FROM_UNIXTIME(NULL)),INTERVAL 1 HOUR); + --echo End of 5.1 tests -- cgit v1.2.1