Commit 70575456 authored by Michael Widenius's avatar Michael Widenius

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)
parent 58f56e12
...@@ -23,8 +23,7 @@ flush tables; ...@@ -23,8 +23,7 @@ flush tables;
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/t1.MYI ; remove_file $MYSQLD_DATADIR/test/t1.MYI ;
drop table if exists t1; drop table if exists t1;
save_master_pos;
connection slave; --source include/master-slave-end.inc
sync_with_master;
# End of 4.1 tests # End of 4.1 tests
...@@ -2,6 +2,13 @@ ...@@ -2,6 +2,13 @@
# Basic tests of row-level logging # 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. # First we test tables with only an index.
# #
......
call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired");
DROP TABLE if exists t1,t2,t3,t4,t5,t6; DROP TABLE if exists t1,t2,t3,t4,t5,t6;
SET storage_engine=ARCHIVE; SET storage_engine=ARCHIVE;
CREATE TABLE t1 ( CREATE TABLE t1 (
......
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; drop table if exists t1,t2,t3,t4;
CREATE TABLE t1 ( CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
......
call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired");
drop database if exists mysqltest; drop database if exists mysqltest;
create database mysqltest; create database mysqltest;
use mysqltest; use mysqltest;
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/have_maria.inc --source include/have_maria.inc
call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired");
let $MARIA_LOG=.; let $MARIA_LOG=.;
--disable_warnings --disable_warnings
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
call mtr.add_suppression("Checking table: '\\..mysqltest.t_corrupted2'"); call mtr.add_suppression("Checking table: '\\..mysqltest.t_corrupted2'");
call mtr.add_suppression("Recovering 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 '\\..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 --enable_query_log
# Note: we're setting an environment variable (not prefixing it by $), # Note: we're setting an environment variable (not prefixing it by $),
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
--disable_query_log --disable_query_log
call mtr.add_suppression("..test.t1_will_crash"); 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("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 --enable_query_log
--source include/have_partition.inc --source include/have_partition.inc
......
...@@ -4,3 +4,4 @@ reset master; ...@@ -4,3 +4,4 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
call mtr.add_suppression("Aborted connection");
...@@ -5,6 +5,7 @@ reset slave; ...@@ -5,6 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032"); 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 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"); 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; SET @old_slave_exec_mode= @@global.slave_exec_mode;
......
...@@ -4,6 +4,9 @@ reset master; ...@@ -4,6 +4,9 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; 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 **** **** Test case for BUG#16487 ****
**** Master **** **** Master ****
CREATE TABLE test.t4 (a int); CREATE TABLE test.t4 (a int);
......
...@@ -4,6 +4,7 @@ reset master; ...@@ -4,6 +4,7 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
call mtr.add_suppression("Can't find record in 't.'");
CREATE DATABASE test_ignore; CREATE DATABASE test_ignore;
**** On Master **** **** On Master ****
SHOW DATABASES; SHOW DATABASES;
...@@ -27,6 +28,10 @@ t2 ...@@ -27,6 +28,10 @@ t2
INSERT INTO t2 VALUES (3,3), (4,4); INSERT INTO t2 VALUES (3,3), (4,4);
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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 # # use `test`; CREATE TABLE t1 (a INT, b INT)
master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
......
...@@ -5,6 +5,7 @@ reset slave; ...@@ -5,6 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: .*"); 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] [on slave]
SET @old_slave_exec_mode= @@global.slave_exec_mode; SET @old_slave_exec_mode= @@global.slave_exec_mode;
######## Run with slave_exec_mode=STRICT ######## ######## Run with slave_exec_mode=STRICT ########
......
...@@ -5,6 +5,7 @@ reset slave; ...@@ -5,6 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
call mtr.add_suppression("Deadlock found"); call mtr.add_suppression("Deadlock found");
call mtr.add_suppression("Can't find record in 't.'");
**** On Master **** **** On Master ****
SET SESSION BINLOG_FORMAT=ROW; SET SESSION BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT); CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
......
...@@ -7,4 +7,6 @@ ...@@ -7,4 +7,6 @@
source include/master-slave.inc; source include/master-slave.inc;
call mtr.add_suppression("Aborted connection");
# End of tests # End of tests
...@@ -9,6 +9,7 @@ source include/have_innodb.inc; ...@@ -9,6 +9,7 @@ source include/have_innodb.inc;
# Add suppression for expected warning(s) in slaves error log # 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("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 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"); call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
......
...@@ -2,6 +2,10 @@ source include/master-slave.inc; ...@@ -2,6 +2,10 @@ source include/master-slave.inc;
let collation=utf8_unicode_ci; let collation=utf8_unicode_ci;
--source include/have_collation.inc --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 # BUG#16487
# #
......
...@@ -4,10 +4,13 @@ let $SERVER_VERSION=`select version()`; ...@@ -4,10 +4,13 @@ let $SERVER_VERSION=`select version()`;
#This test case is not written for NDB, the result files #This test case is not written for NDB, the result files
#will not match when NDB is the default engine #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 --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 # Bug#15942 (RBR ignores --binlog_ignore_db and tries to map to table
# on slave for writes) # on slave for writes)
......
...@@ -9,6 +9,7 @@ source include/master-slave.inc; ...@@ -9,6 +9,7 @@ source include/master-slave.inc;
connection slave; connection slave;
call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: .*"); 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] --echo [on slave]
connection slave; connection slave;
......
...@@ -2,6 +2,7 @@ source include/master-slave.inc; ...@@ -2,6 +2,7 @@ source include/master-slave.inc;
source include/have_innodb.inc; source include/have_innodb.inc;
call mtr.add_suppression("Deadlock found"); call mtr.add_suppression("Deadlock found");
call mtr.add_suppression("Can't find record in 't.'");
--echo **** On Master **** --echo **** On Master ****
connection master; connection master;
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
-- source include/have_archive.inc -- source include/have_archive.inc
-- source include/have_binlog_format_mixed_or_statement.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 --disable_warnings
DROP TABLE if exists t1,t2,t3,t4,t5,t6; DROP TABLE if exists t1,t2,t3,t4,t5,t6;
--enable_warnings --enable_warnings
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
--source include/have_csv.inc --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 # Simple select test
# #
......
...@@ -2638,17 +2638,11 @@ void handler::print_keydup_error(uint key_nr, const char *msg) ...@@ -2638,17 +2638,11 @@ void handler::print_keydup_error(uint key_nr, const char *msg)
- table->alias - table->alias
*/ */
#ifndef DBUG_OFF
#define SET_FATAL_ERROR fatal_error=1 #define SET_FATAL_ERROR fatal_error=1
#else
#define SET_FATAL_ERROR
#endif
void handler::print_error(int error, myf errflag) void handler::print_error(int error, myf errflag)
{ {
#ifndef DBUG_OFF
bool fatal_error= 0; bool fatal_error= 0;
#endif
DBUG_ENTER("handler::print_error"); DBUG_ENTER("handler::print_error");
DBUG_PRINT("enter",("error: %d",error)); DBUG_PRINT("enter",("error: %d",error));
...@@ -2855,6 +2849,15 @@ void handler::print_error(int error, myf errflag) ...@@ -2855,6 +2849,15 @@ void handler::print_error(int error, myf errflag)
DBUG_VOID_RETURN; 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); my_error(textno, errflag, table_share->table_name.str, error);
DBUG_ASSERT(!fatal_error || !debug_assert_if_crashed_table); DBUG_ASSERT(!fatal_error || !debug_assert_if_crashed_table);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
......
...@@ -11148,6 +11148,7 @@ create_internal_tmp_table_from_heap2(THD *thd, TABLE *table, ...@@ -11148,6 +11148,7 @@ create_internal_tmp_table_from_heap2(THD *thd, TABLE *table,
const char *save_proc_info; const char *save_proc_info;
int write_err; int write_err;
DBUG_ENTER("create_internal_tmp_table_from_heap2"); DBUG_ENTER("create_internal_tmp_table_from_heap2");
LINT_INIT(write_err);
if (table->s->db_type() != heap_hton || if (table->s->db_type() != heap_hton ||
error != HA_ERR_RECORD_FILE_FULL) error != HA_ERR_RECORD_FILE_FULL)
......
...@@ -22,7 +22,7 @@ noinst_LTLIBRARIES = libmystrings.la ...@@ -22,7 +22,7 @@ noinst_LTLIBRARIES = libmystrings.la
# Exact one of ASSEMBLER_X # Exact one of ASSEMBLER_X
if ASSEMBLER_x86 if ASSEMBLER_x86
ASRCS = strings-x86.s longlong2str-x86.s my_strtoll10-x86.s 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 else
if ASSEMBLER_sparc32 if ASSEMBLER_sparc32
# These file MUST all be on the same line!! Otherwise automake # These file MUST all be on the same line!! Otherwise automake
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment