2008-04-08 16:51:26 +02:00
|
|
|
delimiter ||;
|
|
|
|
|
|
|
|
use mtr||
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Create table where testcases can insert patterns to
|
2008-10-13 20:33:08 +02:00
|
|
|
-- be suppressed
|
2008-04-08 16:51:26 +02:00
|
|
|
--
|
2008-10-13 20:33:08 +02:00
|
|
|
CREATE TABLE test_suppressions (
|
2008-04-08 16:51:26 +02:00
|
|
|
pattern VARCHAR(255)
|
2008-09-04 05:26:12 +02:00
|
|
|
) ENGINE=MyISAM||
|
2008-04-08 16:51:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Declare a trigger that makes sure
|
|
|
|
-- no invalid patterns can be inserted
|
2008-10-13 20:33:08 +02:00
|
|
|
-- into test_suppressions
|
2008-04-08 16:51:26 +02:00
|
|
|
--
|
|
|
|
/*!50002
|
|
|
|
CREATE DEFINER=root@localhost TRIGGER ts_insert
|
2008-10-13 20:33:08 +02:00
|
|
|
BEFORE INSERT ON test_suppressions
|
2008-04-08 16:51:26 +02:00
|
|
|
FOR EACH ROW BEGIN
|
|
|
|
DECLARE dummy INT;
|
|
|
|
SELECT "" REGEXP NEW.pattern INTO dummy;
|
|
|
|
END
|
|
|
|
*/||
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2008-10-13 20:33:08 +02:00
|
|
|
-- Load table with patterns that will be suppressed globally(always)
|
2008-04-08 16:51:26 +02:00
|
|
|
--
|
2008-10-13 20:33:08 +02:00
|
|
|
CREATE TABLE global_suppressions (
|
2008-04-08 16:51:26 +02:00
|
|
|
pattern VARCHAR(255)
|
2008-09-04 05:26:12 +02:00
|
|
|
) ENGINE=MyISAM||
|
2008-04-08 16:51:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
-- Declare a trigger that makes sure
|
|
|
|
-- no invalid patterns can be inserted
|
2008-10-13 20:33:08 +02:00
|
|
|
-- into global_suppressions
|
2008-04-08 16:51:26 +02:00
|
|
|
--
|
|
|
|
/*!50002
|
|
|
|
CREATE DEFINER=root@localhost TRIGGER gs_insert
|
2008-10-13 20:33:08 +02:00
|
|
|
BEFORE INSERT ON global_suppressions
|
2008-04-08 16:51:26 +02:00
|
|
|
FOR EACH ROW BEGIN
|
|
|
|
DECLARE dummy INT;
|
|
|
|
SELECT "" REGEXP NEW.pattern INTO dummy;
|
|
|
|
END
|
|
|
|
*/||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2008-10-13 20:33:08 +02:00
|
|
|
-- Insert patterns that should always be suppressed
|
2008-04-08 16:51:26 +02:00
|
|
|
--
|
2008-10-13 20:33:08 +02:00
|
|
|
INSERT INTO global_suppressions VALUES
|
2011-03-30 14:33:53 +02:00
|
|
|
(".SELECT UNIX_TIMESTAMP... failed on master"),
|
2008-04-08 16:51:26 +02:00
|
|
|
("Aborted connection"),
|
|
|
|
("Client requested master to start replication from impossible position"),
|
|
|
|
("Could not find first log file name in binary log"),
|
|
|
|
("Enabling keys got errno"),
|
|
|
|
("Error reading master configuration"),
|
|
|
|
("Error reading packet"),
|
|
|
|
("Event Scheduler"),
|
|
|
|
("Failed to open log"),
|
|
|
|
("Failed to open the existing master info file"),
|
|
|
|
("Forcing shutdown of [0-9]* plugins"),
|
2008-12-25 10:53:24 +01:00
|
|
|
("Forcing close of thread"),
|
2008-04-08 16:51:26 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
Due to timing issues, it might be that this warning
|
|
|
|
is printed when the server shuts down and the
|
|
|
|
computer is loaded.
|
|
|
|
*/
|
|
|
|
|
|
|
|
("Got error [0-9]* when reading table"),
|
|
|
|
("Incorrect definition of table"),
|
|
|
|
("Incorrect information in file"),
|
|
|
|
("InnoDB: Warning: we did not need to do crash recovery"),
|
|
|
|
("Invalid \\(old\\?\\) table or database name"),
|
|
|
|
("Lock wait timeout exceeded"),
|
|
|
|
("Log entry on master is longer than max_allowed_packet"),
|
|
|
|
("unknown option '--loose-"),
|
|
|
|
("unknown variable 'loose-"),
|
|
|
|
("You have forced lower_case_table_names to 0 through a command-line option"),
|
|
|
|
("Setting lower_case_table_names=2"),
|
|
|
|
("NDB Binlog:"),
|
|
|
|
("NDB: failed to setup table"),
|
|
|
|
("NDB: only row based binary logging"),
|
|
|
|
("Neither --relay-log nor --relay-log-index were used"),
|
|
|
|
("Query partially completed"),
|
|
|
|
("Slave I.O thread aborted while waiting for relay log"),
|
|
|
|
("Slave SQL thread is stopped because UNTIL condition"),
|
|
|
|
("Slave SQL thread retried transaction"),
|
|
|
|
("Slave \\(additional info\\)"),
|
|
|
|
("Slave: .*Duplicate column name"),
|
|
|
|
("Slave: .*master may suffer from"),
|
|
|
|
("Slave: According to the master's version"),
|
|
|
|
("Slave: Column [0-9]* type mismatch"),
|
|
|
|
("Slave: Error .* doesn't exist"),
|
|
|
|
("Slave: Error .*Unknown table"),
|
|
|
|
("Slave: Error in Write_rows event: "),
|
|
|
|
("Slave: Field .* of table .* has no default value"),
|
|
|
|
("Slave: Field .* doesn't have a default value"),
|
|
|
|
("Slave: Query caused different errors on master and slave"),
|
|
|
|
("Slave: Table .* doesn't exist"),
|
|
|
|
("Slave: Table width mismatch"),
|
|
|
|
("Slave: The incident LOST_EVENTS occured on the master"),
|
|
|
|
("Slave: Unknown error.* 1105"),
|
|
|
|
("Slave: Can't drop database.* database doesn't exist"),
|
|
|
|
("Time-out in NDB"),
|
|
|
|
("Warning:\s+One can only use the --user.*root"),
|
|
|
|
("Warning:\s+Table:.* on (delete|rename)"),
|
|
|
|
("You have an error in your SQL syntax"),
|
|
|
|
("deprecated"),
|
|
|
|
("description of time zone"),
|
|
|
|
("equal MySQL server ids"),
|
|
|
|
("error .*connecting to master"),
|
|
|
|
("error reading log entry"),
|
|
|
|
("lower_case_table_names is set"),
|
|
|
|
("skip-name-resolve mode"),
|
|
|
|
("slave SQL thread aborted"),
|
|
|
|
("Slave: .*Duplicate entry"),
|
|
|
|
|
2009-08-25 15:56:50 +02:00
|
|
|
("Statement may not be safe to log in statement format"),
|
2008-04-08 16:51:26 +02:00
|
|
|
|
|
|
|
/* innodb foreign key tests that fail in ALTER or RENAME produce this */
|
2009-07-10 13:35:53 +02:00
|
|
|
("InnoDB: Error: in ALTER TABLE `test`.`t[123]`"),
|
2008-04-08 16:51:26 +02:00
|
|
|
("InnoDB: Error: in RENAME TABLE table `test`.`t1`"),
|
2009-07-10 13:35:53 +02:00
|
|
|
("InnoDB: Error: table `test`.`t[123]` does not exist in the InnoDB internal"),
|
2008-04-08 16:51:26 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
BUG#32080 - Excessive warnings on Solaris: setrlimit could not
|
|
|
|
change the size of core files
|
|
|
|
*/
|
|
|
|
("setrlimit could not change the size of core files to 'infinity'"),
|
|
|
|
|
2009-09-23 10:21:16 +02:00
|
|
|
("The slave I.O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master."),
|
2008-04-24 13:26:28 +02:00
|
|
|
|
2009-09-24 15:19:06 +02:00
|
|
|
("Slave: Unknown table 't1' Error_code: 1051"),
|
2008-04-24 13:26:28 +02:00
|
|
|
|
2010-01-15 16:27:55 +01:00
|
|
|
/* Maria storage engine dependent tests */
|
|
|
|
|
2009-02-15 11:58:34 +01:00
|
|
|
/* maria-recovery.test has warning about missing log file */
|
|
|
|
("File '.*maria_log.000.*' not found \\(Errcode: 2\\)"),
|
|
|
|
/* and about marked-corrupted table */
|
|
|
|
("Table '..mysqltest.t_corrupted1' is crashed, skipping it. Please repair"),
|
|
|
|
/* maria-recover.test corrupts tables on purpose */
|
|
|
|
("Checking table: '..mysqltest.t_corrupted2'"),
|
|
|
|
("Table '..mysqltest.t_corrupted2' is marked as crashed and should be"),
|
|
|
|
("Incorrect key file for table '..mysqltest.t_corrupted2.MAI'"),
|
|
|
|
|
2009-11-12 11:04:01 +01:00
|
|
|
/* Messages from valgrind */
|
|
|
|
("==[0-9]*== Memcheck,"),
|
|
|
|
("==[0-9]*== Copyright"),
|
|
|
|
("==[0-9]*== Using"),
|
|
|
|
("==[0-9]*== For more details"),
|
|
|
|
/* This comes with innodb plugin tests */
|
2009-11-16 14:46:33 +01:00
|
|
|
("==[0-9]*== Warning: set address range perms: large range"),
|
2010-04-09 19:57:11 +02:00
|
|
|
/* valgrind-3.5.0 dumps this */
|
|
|
|
("==[0-9]*== Command: "),
|
2010-02-03 08:49:20 +01:00
|
|
|
|
|
|
|
/* valgrind warnings: invalid file descriptor -1 in syscall
|
|
|
|
write()/read(). Bug #50414 */
|
|
|
|
("==[0-9]*== Warning: invalid file descriptor -1 in syscall write()"),
|
|
|
|
("==[0-9]*== Warning: invalid file descriptor -1 in syscall read()"),
|
|
|
|
|
BUG#47743: rpl.rpl_log_pos fails sporadically
BUG#47983: rpl_extraColmaster_myisam failed in PB2 with "Found
warnings!!"
BUG 45214 fixed the case when get_master_version_and_clock
function, used by the slave, would not report errors. The slave
now detects them and if related to transient network failures, it
prints some warnings and retries to connect. On the other hand,
if not network related, it just gives up and fails.
As such, sometimes, in PB2, the slave comes across some transient
communication issues between master and slave, while calling
get_master_version_and_clock, causing warnings print outs to the
error log. Nevertheless, in such cases slave retries to connect,
in which it succeeds, and the test case continues as it normally
would. But then, at the end of a successful test run, MTR checks
the error log, finds the unexpected warnings and considers them
harmful. This causes MTR to report error and, consequently, PB2
to report a failing test.
We fix this by adding to the global warnings suppress list the
warnings related to transient network failures only, which are
reported while in function get_master_version_and_clock.
2009-11-04 02:56:36 +01:00
|
|
|
/*
|
|
|
|
Transient network failures that cause warnings on reconnect.
|
|
|
|
BUG#47743 and BUG#47983.
|
|
|
|
*/
|
|
|
|
("Slave I/O: Get master SERVER_ID failed with error:.*"),
|
|
|
|
("Slave I/O: Get master clock failed with error:.*"),
|
|
|
|
("Slave I/O: Get master COLLATION_SERVER failed with error:.*"),
|
|
|
|
("Slave I/O: Get master TIME_ZONE failed with error:.*"),
|
2011-05-03 14:01:11 +02:00
|
|
|
("Slave I/O: The slave I/O thread stops because a fatal error is encountered when it tried to SET @master_binlog_checksum on master.*"),
|
|
|
|
("Slave I/O: Get master BINLOG_CHECKSUM failed with error.*"),
|
|
|
|
("Slave I/O: Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error.*"),
|
2008-04-08 16:51:26 +02:00
|
|
|
("THE_LAST_SUPPRESSION")||
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Procedure that uses the above created tables to check
|
|
|
|
-- the servers error log for warnings
|
|
|
|
--
|
2008-04-09 14:38:42 +02:00
|
|
|
CREATE DEFINER=root@localhost PROCEDURE check_warnings(OUT result INT)
|
2008-04-08 16:51:26 +02:00
|
|
|
BEGIN
|
2008-12-05 19:24:10 +01:00
|
|
|
DECLARE `pos` bigint unsigned;
|
2008-04-09 12:27:39 +02:00
|
|
|
|
|
|
|
-- Don't write these queries to binlog
|
|
|
|
SET SQL_LOG_BIN=0;
|
2008-04-08 16:51:26 +02:00
|
|
|
|
2009-01-26 15:20:33 +01:00
|
|
|
--
|
|
|
|
-- Remove mark from lines that are suppressed by global suppressions
|
|
|
|
--
|
|
|
|
UPDATE error_log el, global_suppressions gs
|
|
|
|
SET suspicious=0
|
|
|
|
WHERE el.suspicious=1 AND el.line REGEXP gs.pattern;
|
2008-04-08 16:51:26 +02:00
|
|
|
|
2009-01-26 15:20:33 +01:00
|
|
|
--
|
|
|
|
-- Remove mark from lines that are suppressed by test specific suppressions
|
|
|
|
--
|
|
|
|
UPDATE error_log el, test_suppressions ts
|
|
|
|
SET suspicious=0
|
|
|
|
WHERE el.suspicious=1 AND el.line REGEXP ts.pattern;
|
2008-04-08 16:51:26 +02:00
|
|
|
|
2009-01-26 15:20:33 +01:00
|
|
|
--
|
|
|
|
-- Get the number of marked lines and return result
|
|
|
|
--
|
|
|
|
SELECT COUNT(*) INTO @num_warnings FROM error_log
|
|
|
|
WHERE suspicious=1;
|
2008-04-08 16:51:26 +02:00
|
|
|
|
|
|
|
IF @num_warnings > 0 THEN
|
2009-09-24 16:09:11 +02:00
|
|
|
SELECT line
|
2009-01-26 15:20:33 +01:00
|
|
|
FROM error_log WHERE suspicious=1;
|
2008-10-13 20:33:08 +02:00
|
|
|
--SELECT * FROM test_suppressions;
|
2008-04-09 14:38:42 +02:00
|
|
|
-- Return 2 -> check failed
|
|
|
|
SELECT 2 INTO result;
|
2008-04-08 16:51:26 +02:00
|
|
|
ELSE
|
2008-04-09 14:38:42 +02:00
|
|
|
-- Return 0 -> OK
|
|
|
|
SELECT 0 INTO RESULT;
|
2008-04-08 16:51:26 +02:00
|
|
|
END IF;
|
|
|
|
|
|
|
|
-- Cleanup for next test
|
2008-10-13 20:33:08 +02:00
|
|
|
TRUNCATE test_suppressions;
|
2009-01-26 15:20:33 +01:00
|
|
|
DROP TABLE error_log;
|
2008-04-08 16:51:26 +02:00
|
|
|
|
|
|
|
END||
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Declare a procedure testcases can use to insert test
|
2008-10-13 20:33:08 +02:00
|
|
|
-- specific suppressions
|
2008-04-08 16:51:26 +02:00
|
|
|
--
|
|
|
|
/*!50001
|
|
|
|
CREATE DEFINER=root@localhost
|
2008-10-13 20:33:08 +02:00
|
|
|
PROCEDURE add_suppression(pattern VARCHAR(255))
|
2008-04-08 16:51:26 +02:00
|
|
|
BEGIN
|
2008-10-13 20:33:08 +02:00
|
|
|
INSERT INTO test_suppressions (pattern) VALUES (pattern);
|
2008-04-08 16:51:26 +02:00
|
|
|
END
|
|
|
|
*/||
|
|
|
|
|
|
|
|
|