diff options
author | Michael Widenius <monty@askmonty.org> | 2011-01-20 19:08:12 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-01-20 19:08:12 +0200 |
commit | 7057545699a2a614fb444bd3e6ad7d3f1ff31d56 (patch) | |
tree | ba16b64478c22dafdc86a27d4f1af84407835a3d | |
parent | 58f56e12a27a55fdf70e30b96f354912fcd5a61a (diff) | |
download | mariadb-git-7057545699a2a614fb444bd3e6ad7d3f1ff31d56.tar.gz |
Fixed some mysql-test-run failures and compile warnings/errors
Added logging of all possible fatal table errors if --log-warnings set to > 1
mysql-test/extra/rpl_tests/rpl_EE_err.test:
Safety fix
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/r/archive.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/r/csv.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/maria/r/maria-autozerofill.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/maria/t/maria-autozerofill.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/maria/t/maria-recover.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/parts/t/partition_recover_myisam.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_bug38694.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_idempotency.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_ignore_table.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_row_conflicts.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_temporary_errors.result:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_bug38694.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_idempotency.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_ignore_table.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_row_conflicts.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/t/archive.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/t/csv.test:
Added suppression of possible error message (so that one can run test with --log-warnings=2)
sql/handler.cc:
If running with --assert-of-crashed-table or --log-warnings > 1 then print engine error to log
sql/sql_select.cc:
Disable not initialized warning from gcc
strings/Makefile.am:
Fixed compiler error on Solaris 10 (duplicate strmov() function)
25 files changed, 59 insertions, 11 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_EE_err.test b/mysql-test/extra/rpl_tests/rpl_EE_err.test index 205bbe79dac..3fa50af344b 100644 --- a/mysql-test/extra/rpl_tests/rpl_EE_err.test +++ b/mysql-test/extra/rpl_tests/rpl_EE_err.test @@ -23,8 +23,7 @@ flush tables; let $MYSQLD_DATADIR= `select @@datadir`; remove_file $MYSQLD_DATADIR/test/t1.MYI ; drop table if exists t1; -save_master_pos; -connection slave; -sync_with_master; + +--source include/master-slave-end.inc # End of 4.1 tests diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index 84f7b79e733..998e7e7ecd5 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -2,6 +2,13 @@ # Basic tests of row-level logging # +--disable_query_log +--disable_result_log +# Add suppression for expected warning(s) in error log +call mtr.add_suppression("Can't find record in 't.'"); +--enable_query_log +--enable_result_log + # # First we test tables with only an index. # diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index ae79e237ade..73a9090b1e3 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired"); DROP TABLE if exists t1,t2,t3,t4,t5,t6; SET storage_engine=ARCHIVE; CREATE TABLE t1 ( diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result index 1cff420e34e..4c3529fb227 100644 --- a/mysql-test/r/csv.result +++ b/mysql-test/r/csv.result @@ -1,3 +1,5 @@ +call mtr.add_suppression("Table 'test_repair_table2' is marked as crashed and should be repaired"); +call mtr.add_suppression("Table 'test_repair_table4' is marked as crashed and should be repaired"); drop table if exists t1,t2,t3,t4; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, diff --git a/mysql-test/suite/maria/r/maria-autozerofill.result b/mysql-test/suite/maria/r/maria-autozerofill.result index 0b069cd7a52..e31cf9fa19b 100644 --- a/mysql-test/suite/maria/r/maria-autozerofill.result +++ b/mysql-test/suite/maria/r/maria-autozerofill.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired"); drop database if exists mysqltest; create database mysqltest; use mysqltest; diff --git a/mysql-test/suite/maria/t/maria-autozerofill.test b/mysql-test/suite/maria/t/maria-autozerofill.test index 45eb39fbc21..b46b458d89e 100644 --- a/mysql-test/suite/maria/t/maria-autozerofill.test +++ b/mysql-test/suite/maria/t/maria-autozerofill.test @@ -5,6 +5,8 @@ --source include/not_embedded.inc --source include/have_maria.inc +call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired"); + let $MARIA_LOG=.; --disable_warnings diff --git a/mysql-test/suite/maria/t/maria-recover.test b/mysql-test/suite/maria/t/maria-recover.test index e9ae0933d4c..38aff27bd8d 100644 --- a/mysql-test/suite/maria/t/maria-recover.test +++ b/mysql-test/suite/maria/t/maria-recover.test @@ -8,6 +8,8 @@ call mtr.add_suppression("Checking table: '\\..mysqltest.t_corrupted2'"); call mtr.add_suppression("Recovering table: '\\..mysqltest.t_corrupted2'"); call mtr.add_suppression("Table '\\..mysqltest.t_corrupted2' is marked as crashed and should be repaired"); +call mtr.add_suppression("Table 't_corrupted2' is marked as crashed and should be repaired"); + --enable_query_log # Note: we're setting an environment variable (not prefixing it by $), diff --git a/mysql-test/suite/parts/t/partition_recover_myisam.test b/mysql-test/suite/parts/t/partition_recover_myisam.test index c96cd938f8b..f73457fc526 100644 --- a/mysql-test/suite/parts/t/partition_recover_myisam.test +++ b/mysql-test/suite/parts/t/partition_recover_myisam.test @@ -3,6 +3,7 @@ --disable_query_log call mtr.add_suppression("..test.t1_will_crash"); call mtr.add_suppression("Got an error from unknown thread, ha_myisam.cc"); +call mtr.add_suppression("Table 't1_will_crash' is marked as crashed and should be repaired"); --enable_query_log --source include/have_partition.inc diff --git a/mysql-test/suite/rpl/r/rpl_bug38694.result b/mysql-test/suite/rpl/r/rpl_bug38694.result index 711c4a91c03..b062af95b7c 100644 --- a/mysql-test/suite/rpl/r/rpl_bug38694.result +++ b/mysql-test/suite/rpl/r/rpl_bug38694.result @@ -4,3 +4,4 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +call mtr.add_suppression("Aborted connection"); diff --git a/mysql-test/suite/rpl/r/rpl_idempotency.result b/mysql-test/suite/rpl/r/rpl_idempotency.result index bfdcbc6fa23..9478aa327f4 100644 --- a/mysql-test/suite/rpl/r/rpl_idempotency.result +++ b/mysql-test/suite/rpl/r/rpl_idempotency.result @@ -5,6 +5,7 @@ reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032"); +call mtr.add_suppression("Can't find record in 't.'"); call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); SET @old_slave_exec_mode= @@global.slave_exec_mode; diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result index e77be425270..cec0c59a8cc 100644 --- a/mysql-test/suite/rpl/r/rpl_ignore_table.result +++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result @@ -4,6 +4,9 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +call mtr.add_suppression("Can't find record in 't.'"); +call mtr.add_suppression("Can't find record in 'user'"); +call mtr.add_suppression("Can't find record in 'tables_priv'"); **** Test case for BUG#16487 **** **** Master **** CREATE TABLE test.t4 (a int); diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result index 458ae53e79c..a355a07c52f 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +call mtr.add_suppression("Can't find record in 't.'"); CREATE DATABASE test_ignore; **** On Master **** SHOW DATABASES; @@ -27,6 +28,10 @@ t2 INSERT INTO t2 VALUES (3,3), (4,4); show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (mtr.test_suppressions) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b INT) master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) diff --git a/mysql-test/suite/rpl/r/rpl_row_conflicts.result b/mysql-test/suite/rpl/r/rpl_row_conflicts.result index 0f15bfc7156..3233a0fbb00 100644 --- a/mysql-test/suite/rpl/r/rpl_row_conflicts.result +++ b/mysql-test/suite/rpl/r/rpl_row_conflicts.result @@ -5,6 +5,7 @@ reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: .*"); +call mtr.add_suppression("Can't find record in 't.'"); [on slave] SET @old_slave_exec_mode= @@global.slave_exec_mode; ######## Run with slave_exec_mode=STRICT ######## diff --git a/mysql-test/suite/rpl/r/rpl_temporary_errors.result b/mysql-test/suite/rpl/r/rpl_temporary_errors.result index 023f9a850ab..e17ce4f1716 100644 --- a/mysql-test/suite/rpl/r/rpl_temporary_errors.result +++ b/mysql-test/suite/rpl/r/rpl_temporary_errors.result @@ -5,6 +5,7 @@ reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; call mtr.add_suppression("Deadlock found"); +call mtr.add_suppression("Can't find record in 't.'"); **** On Master **** SET SESSION BINLOG_FORMAT=ROW; CREATE TABLE t1 (a INT PRIMARY KEY, b INT); diff --git a/mysql-test/suite/rpl/t/rpl_bug38694.test b/mysql-test/suite/rpl/t/rpl_bug38694.test index 41b11d271b9..32128a44121 100644 --- a/mysql-test/suite/rpl/t/rpl_bug38694.test +++ b/mysql-test/suite/rpl/t/rpl_bug38694.test @@ -7,4 +7,6 @@ source include/master-slave.inc; +call mtr.add_suppression("Aborted connection"); + # End of tests diff --git a/mysql-test/suite/rpl/t/rpl_idempotency.test b/mysql-test/suite/rpl/t/rpl_idempotency.test index c96b88a1b1a..ac0749bbec8 100644 --- a/mysql-test/suite/rpl/t/rpl_idempotency.test +++ b/mysql-test/suite/rpl/t/rpl_idempotency.test @@ -9,6 +9,7 @@ source include/have_innodb.inc; # Add suppression for expected warning(s) in slaves error log call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032"); +call mtr.add_suppression("Can't find record in 't.'"); call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test index 15c4b193669..d3a087e0e79 100644 --- a/mysql-test/suite/rpl/t/rpl_ignore_table.test +++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test @@ -2,6 +2,10 @@ source include/master-slave.inc; let collation=utf8_unicode_ci; --source include/have_collation.inc +call mtr.add_suppression("Can't find record in 't.'"); +call mtr.add_suppression("Can't find record in 'user'"); +call mtr.add_suppression("Can't find record in 'tables_priv'"); + # # BUG#16487 # diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test index 2bf5a01a71f..e063a52b44e 100644 --- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test +++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test @@ -4,10 +4,13 @@ let $SERVER_VERSION=`select version()`; #This test case is not written for NDB, the result files #will not match when NDB is the default engine --- source include/not_ndb_default.inc +--source include/not_ndb_default.inc --source include/master-slave.inc +# Add suppression for expected warning(s) in slaves error log +call mtr.add_suppression("Can't find record in 't.'"); + # Bug#15942 (RBR ignores --binlog_ignore_db and tries to map to table # on slave for writes) diff --git a/mysql-test/suite/rpl/t/rpl_row_conflicts.test b/mysql-test/suite/rpl/t/rpl_row_conflicts.test index 59757e2e802..e9c62c1f77c 100644 --- a/mysql-test/suite/rpl/t/rpl_row_conflicts.test +++ b/mysql-test/suite/rpl/t/rpl_row_conflicts.test @@ -9,6 +9,7 @@ source include/master-slave.inc; connection slave; call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: .*"); +call mtr.add_suppression("Can't find record in 't.'"); --echo [on slave] connection slave; diff --git a/mysql-test/suite/rpl/t/rpl_temporary_errors.test b/mysql-test/suite/rpl/t/rpl_temporary_errors.test index 6b1ba558d2d..0a36f31201e 100644 --- a/mysql-test/suite/rpl/t/rpl_temporary_errors.test +++ b/mysql-test/suite/rpl/t/rpl_temporary_errors.test @@ -2,6 +2,7 @@ source include/master-slave.inc; source include/have_innodb.inc; call mtr.add_suppression("Deadlock found"); +call mtr.add_suppression("Can't find record in 't.'"); --echo **** On Master **** connection master; diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index c966b51d861..5b819620e29 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -5,6 +5,8 @@ -- source include/have_archive.inc -- source include/have_binlog_format_mixed_or_statement.inc +call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired"); + --disable_warnings DROP TABLE if exists t1,t2,t3,t4,t5,t6; --enable_warnings diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test index 4e337d54660..fd08f7c5a40 100644 --- a/mysql-test/t/csv.test +++ b/mysql-test/t/csv.test @@ -4,6 +4,9 @@ --source include/have_csv.inc +call mtr.add_suppression("Table 'test_repair_table2' is marked as crashed and should be repaired"); +call mtr.add_suppression("Table 'test_repair_table4' is marked as crashed and should be repaired"); + # # Simple select test # diff --git a/sql/handler.cc b/sql/handler.cc index 249699fae6d..00646dda7aa 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2638,17 +2638,11 @@ void handler::print_keydup_error(uint key_nr, const char *msg) - table->alias */ -#ifndef DBUG_OFF #define SET_FATAL_ERROR fatal_error=1 -#else -#define SET_FATAL_ERROR -#endif void handler::print_error(int error, myf errflag) { -#ifndef DBUG_OFF bool fatal_error= 0; -#endif DBUG_ENTER("handler::print_error"); DBUG_PRINT("enter",("error: %d",error)); @@ -2855,6 +2849,15 @@ void handler::print_error(int error, myf errflag) DBUG_VOID_RETURN; } } + if (fatal_error && (debug_assert_if_crashed_table || + global_system_variables.log_warnings > 1)) + { + /* + Log error to log before we crash or if extended warnings are requested + */ + errflag|= ME_NOREFRESH; + } + my_error(textno, errflag, table_share->table_name.str, error); DBUG_ASSERT(!fatal_error || !debug_assert_if_crashed_table); DBUG_VOID_RETURN; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 6029165457f..1d0aed61cd8 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -11148,6 +11148,7 @@ create_internal_tmp_table_from_heap2(THD *thd, TABLE *table, const char *save_proc_info; int write_err; DBUG_ENTER("create_internal_tmp_table_from_heap2"); + LINT_INIT(write_err); if (table->s->db_type() != heap_hton || error != HA_ERR_RECORD_FILE_FULL) diff --git a/strings/Makefile.am b/strings/Makefile.am index 6a09abe7479..f02fa18c474 100644 --- a/strings/Makefile.am +++ b/strings/Makefile.am @@ -22,7 +22,7 @@ noinst_LTLIBRARIES = libmystrings.la # Exact one of ASSEMBLER_X if ASSEMBLER_x86 ASRCS = strings-x86.s longlong2str-x86.s my_strtoll10-x86.s -CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c str_alloc.c longlong2str_asm.c my_strchr.c strmov.c strmov_overlapp.c +CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c str_alloc.c longlong2str_asm.c my_strchr.c strmov_overlapp.c else if ASSEMBLER_sparc32 # These file MUST all be on the same line!! Otherwise automake |