From 22a9f9b243f1144ea4e58c353109e5aa4cfca50e Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 3 Oct 2009 21:12:24 +0200 Subject: [PATCH 1/3] Fix merge-big.test to properly restore debug settings. Otherwise following tests go crazy in the log, writing gigabytes of data and causing havoc. --- mysql-test/r/merge-big.result | 3 ++- mysql-test/t/merge-big.test | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/merge-big.result b/mysql-test/r/merge-big.result index 967c550e42a..b75c70f986f 100644 --- a/mysql-test/r/merge-big.result +++ b/mysql-test/r/merge-big.result @@ -7,6 +7,7 @@ drop table if exists t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT) ENGINE= MyISAM; LOCK TABLE t1 WRITE; # connection con1 +SET @orig_debug=@@debug; SET GLOBAL debug="+d,sleep_open_and_lock_after_open"; INSERT INTO t1 VALUES (1); # connection default @@ -21,6 +22,6 @@ SELECT * FROM t1; c1 UNLOCK TABLES; # connection con1 -SET GLOBAL debug="-d,sleep_open_and_lock_after_open"; +SET GLOBAL debug=@orig_debug; # connection default DROP TABLE t1; diff --git a/mysql-test/t/merge-big.test b/mysql-test/t/merge-big.test index 62af9f22299..d39c2973688 100644 --- a/mysql-test/t/merge-big.test +++ b/mysql-test/t/merge-big.test @@ -43,6 +43,7 @@ LOCK TABLE t1 WRITE; --echo # connection con1 connect (con1,localhost,root,,); let $con1_id= `SELECT CONNECTION_ID()`; + SET @orig_debug=@@debug; SET GLOBAL debug="+d,sleep_open_and_lock_after_open"; send INSERT INTO t1 VALUES (1); --echo # connection default @@ -74,7 +75,7 @@ UNLOCK TABLES; --echo # connection con1 connection con1; reap; - SET GLOBAL debug="-d,sleep_open_and_lock_after_open"; + SET GLOBAL debug=@orig_debug; disconnect con1; --echo # connection default connection default; From 59f80387ba98547878469511fa93745be30f8138 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 3 Oct 2009 22:13:58 +0200 Subject: [PATCH 2/3] Fix some compiler warnings cause by GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29478 storage/maria/ma_blockrec.c: GCC warns about const vs. non-const despite cast (but it is in any case cleaner to avoid the cast completely) support-files/compiler_warnings.supp: Silence a wrong compiler warning caused by GCC bug. --- storage/maria/ma_blockrec.c | 10 +++++----- support-files/compiler_warnings.supp | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index 0ac73f89776..694c8b7b5ff 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -5448,7 +5448,7 @@ static size_t fill_insert_undo_parts(MARIA_HA *info, const uchar *record, Store total blob length to make buffer allocation easier during UNDO */ log_parts->str= info->length_buff; - log_parts->length= (uint) (ma_store_length((uchar *) log_parts->str, + log_parts->length= (uint) (ma_store_length(info->length_buff, info->cur_row.blob_length) - (uchar*) log_parts->str); row_length+= log_parts->length; @@ -5592,7 +5592,7 @@ static size_t fill_update_undo_parts(MARIA_HA *info, const uchar *oldrec, MARIA_SHARE *share= info->s; MARIA_COLUMNDEF *column, *end_column; MARIA_ROW *old_row= &info->cur_row, *new_row= &info->new_row; - uchar *field_data, *start_field_data; + uchar *field_data, *start_field_data, *length_str; uchar *old_field_lengths= old_row->field_lengths; uchar *new_field_lengths= new_row->field_lengths; size_t row_length= 0; @@ -5749,9 +5749,9 @@ static size_t fill_update_undo_parts(MARIA_HA *info, const uchar *oldrec, /* Store length of field length data before the field/field_lengths */ field_lengths= (uint) (field_data - start_field_data); - start_log_parts->str= ((start_field_data - - ma_calc_length_for_store_length(field_lengths))); - ma_store_length((uchar*)start_log_parts->str, field_lengths); + length_str= start_field_data - ma_calc_length_for_store_length(field_lengths); + start_log_parts->str= length_str; + ma_store_length(length_str, field_lengths); start_log_parts->length= (size_t) (field_data - start_log_parts->str); row_length+= start_log_parts->length; DBUG_RETURN(row_length); diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp index 535b8666ec1..9f3048ad996 100644 --- a/support-files/compiler_warnings.supp +++ b/support-files/compiler_warnings.supp @@ -109,3 +109,6 @@ ma_packrec.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 550- # .* : .*no matching operator delete found; memory will not be freed if initialization throws an exception.* ctype-simple.c : .*unary minus operator applied to unsigned type, result still unsigned.* + +# Wrong warning due to GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29478 +regexec\.c : .*passing argument 3 of.*matcher.* discards qualifiers from pointer target type.* From 02c33646b31d9b468dcefec721f4a5343bae5fc8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 4 Oct 2009 01:20:51 +0200 Subject: [PATCH 3/3] Test suite fixes: - Don't omit the @@debug variable from testcase check, since it can cause real problems. - Fix some bad merges by reverting to be identical to MySQL 5.1. mysql-test/include/mtr_check.sql: Don't omit the @@debug variable from testcase check, since it can cause real problems. mysql-test/r/mysqlbinlog_row_big.result: Fix incorrect merge. mysql-test/r/variables-big.result: Fix incorrect merge, by reverting to MySQL 5.1 version. mysql-test/t/mysqlbinlog_row_big.test: Fix incorrect merge. mysql-test/t/variables-big.test: Fix incorrect merge, by reverting to MySQL 5.1 version. --- mysql-test/include/mtr_check.sql | 2 +- mysql-test/r/mysqlbinlog_row_big.result | 6 ---- mysql-test/r/variables-big.result | 40 ++++++++++++------------- mysql-test/t/mysqlbinlog_row_big.test | 15 ---------- mysql-test/t/variables-big.test | 37 ++++++++++++----------- 5 files changed, 40 insertions(+), 60 deletions(-) diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql index ea1435d750c..798b0774849 100644 --- a/mysql-test/include/mtr_check.sql +++ b/mysql-test/include/mtr_check.sql @@ -12,7 +12,7 @@ BEGIN -- Dump all global variables except those -- that are supposed to change SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE variable_name != 'timestamp' AND variable_name != "debug" + WHERE variable_name != 'timestamp' AND variable_name != 'INNODB_IBUF_MAX_SIZE' ORDER BY variable_name; diff --git a/mysql-test/r/mysqlbinlog_row_big.result b/mysql-test/r/mysqlbinlog_row_big.result index 57105d46fbd..46fa0dc79cd 100644 --- a/mysql-test/r/mysqlbinlog_row_big.result +++ b/mysql-test/r/mysqlbinlog_row_big.result @@ -1,9 +1,4 @@ # -# We need big packets. -# -SET @old_global_max_allowed_packet=@@global.max_allowed_packet; -SET @@global.max_allowed_packet= 1024*1024*1024; -# # Preparatory cleanup. # DROP TABLE IF EXISTS t1; @@ -104,5 +99,4 @@ FLUSH LOGS; # reset variable value to pass testcase checks SET @@global.max_allowed_packet = 1048576; DROP TABLE t1; -SET @@global.max_allowed_packet=@old_global_max_allowed_packet; remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out diff --git a/mysql-test/r/variables-big.result b/mysql-test/r/variables-big.result index 2c178999a2c..960fc6d22f4 100644 --- a/mysql-test/r/variables-big.result +++ b/mysql-test/r/variables-big.result @@ -1,20 +1,20 @@ -set session transaction_prealloc_size=1024*1024*1024*1; -select @pid_temp = (select ID from information_schema.processlist) as 'TRUE'; -TRUE -1 -set session transaction_prealloc_size=1024*1024*1024*2; -select @pid_temp = (select ID from information_schema.processlist) as 'TRUE'; -TRUE -1 -set session transaction_prealloc_size=1024*1024*1024*3; -select @pid_temp = (select ID from information_schema.processlist) as 'TRUE'; -TRUE -1 -set session transaction_prealloc_size=1024*1024*1024*4; -select @pid_temp = (select ID from information_schema.processlist) as 'TRUE'; -TRUE -1 -set session transaction_prealloc_size=1024*1024*1024*5; -select @pid_temp = (select ID from information_schema.processlist) as 'TRUE'; -TRUE -1 +SET SESSION transaction_prealloc_size=1024*1024*1024*1; +SHOW PROCESSLIST; +Id User Host db Command Time State Info + root localhost test Query