From 6a6c9f6e0b5b6671df5c81af3dd774f90a2a192f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Jun 2003 16:35:20 +0200 Subject: Better error reporting in mysql-test-run (don't hide the important message with 'head'). Test fix (this sync_with_master was nonsense). Now all tests pass in 4.0 in autobuild. mysql-test/mysql-test-run.sh: Error reporting (how mysql-test-run filters the messages which mysqltest prints on stderr) is not reliable. It does a 'head the first line only' which in my case caused me to lose some time, because in fact the worrying message was on the second line (logically, the one which caused the die() is at the end of the $TIMEFILE file, not at the beginning). Doing a 'tail' is better but not perfect (depending on the build, one may get "Maximum memory usage" as the last line); it's always good to have all messages and spot the important one oneself. So we print all $TIMEFILE (that's a few lines at most). mysql-test/t/rpl_rotate_logs.test: Dont sync_with_master as the SQL slave thread may be stopped at this moment; just wait_for_slave_to_stop. Doing sync_with_master caused a non-deterministic behaviour, because (note that save_master_pos was called to early) sometimes MASTER_POS_WAIT() started before the SQL thread died (because of unique violation) so returned 0, other times it started after the SQL thread died so returned NULL (which is reported by mysqltest as an error, on stderr). --- mysql-test/t/rpl_rotate_logs.test | 3 --- 1 file changed, 3 deletions(-) (limited to 'mysql-test/t/rpl_rotate_logs.test') diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index 6edbf363b1a..9f7f44d7c28 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -73,12 +73,9 @@ insert into t2 values(1234); #same value on the master connection master; -save_master_pos; set insert_id=1234; insert into t2 values(NULL); connection slave; -sync_with_master; - wait_for_slave_to_stop; #restart slave skipping one event -- cgit v1.2.1 From fe29b860c60a36e44ae54df7378834e683545c12 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Jun 2003 23:19:38 +0200 Subject: Changed change_master() to use ER_MASTER_INFO (better display). mysql-test/r/rpl_rotate_logs.result: result update mysql-test/t/rpl_rotate_logs.test: comments and test update with the error code sql/slave.cc: A DBUG_PRINT sql/sql_repl.cc: Use ER_MASTER_INFO instead of custom message and zero error code (which display badly). --- mysql-test/t/rpl_rotate_logs.test | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'mysql-test/t/rpl_rotate_logs.test') diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index 9f7f44d7c28..c4dc5de38da 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -16,14 +16,20 @@ system cat /dev/null > var/slave-data/master.info; system chmod 000 var/slave-data/master.info; connection slave; drop table if exists t1, t2, t3, t4; +# START SLAVE will fail because it can't read the file (mode 000) (system error 13) --error 1201 slave start; system chmod 600 var/slave-data/master.info; +# It will fail again because the file is empty so the slave cannot get valuable +# info about how to connect to the master from it (failure in +# init_strvar_from_file() in init_master_info()). --error 1201 slave start; --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT -# Will get error 13 on Unix systems becasue file is not readable -!eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root'; +# CHANGE MASTER will fail because it first parses master.info before changing it +# (so when master.info is bad, people have to use RESET SLAVE first). +--error 1201 +eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root'; reset slave; --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root'; -- cgit v1.2.1