2008-07-07 11:18:09 +02:00
|
|
|
# ==== Purpose ====
|
|
|
|
#
|
|
|
|
# Verify that slave gives an error message if master updates a table
|
|
|
|
# that slave does not have.
|
|
|
|
#
|
|
|
|
# ==== Method ====
|
|
|
|
#
|
|
|
|
# Create a table on master, wait till it's on slave, remove it from
|
|
|
|
# slave. Then update the table on master.
|
|
|
|
|
2005-12-22 06:39:02 +01:00
|
|
|
--source include/have_binlog_format_row.inc
|
|
|
|
|
|
|
|
source include/master-slave.inc;
|
|
|
|
|
2008-07-07 11:18:09 +02:00
|
|
|
--echo ==== Setup table on master but not on slave ====
|
|
|
|
--echo [on master]
|
|
|
|
CREATE TABLE t1 (a INT);
|
2006-06-05 05:49:06 +04:00
|
|
|
|
2008-07-07 11:18:09 +02:00
|
|
|
--echo [on slave]
|
2005-12-22 06:39:02 +01:00
|
|
|
sync_slave_with_master;
|
2008-07-07 11:18:09 +02:00
|
|
|
DROP TABLE t1;
|
2005-12-22 06:39:02 +01:00
|
|
|
|
2008-07-07 11:18:09 +02:00
|
|
|
--echo ==== Modify table on master ====
|
|
|
|
--echo [on master]
|
2005-12-22 06:39:02 +01:00
|
|
|
connection master;
|
2008-07-07 11:18:09 +02:00
|
|
|
INSERT INTO t1 VALUES (1);
|
2005-12-22 06:39:02 +01:00
|
|
|
|
2008-07-07 11:18:09 +02:00
|
|
|
--echo ==== Verify error on slave ====
|
|
|
|
--echo [on slave]
|
2005-12-22 06:39:02 +01:00
|
|
|
connection slave;
|
2006-06-05 05:49:06 +04:00
|
|
|
# slave should have stopped because can't find table t1
|
2007-06-13 05:52:43 +02:00
|
|
|
--source include/wait_for_slave_sql_to_stop.inc
|
2005-12-22 06:39:02 +01:00
|
|
|
# see if we have a good error message:
|
2008-07-07 11:18:09 +02:00
|
|
|
let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
|
|
|
|
--echo Last_SQL_Error = $err
|
|
|
|
|
|
|
|
--echo ==== Clean up ====
|
2008-07-10 18:09:39 +02:00
|
|
|
source include/stop_slave.inc;
|
2005-12-22 06:39:02 +01:00
|
|
|
|
2008-07-07 11:18:09 +02:00
|
|
|
--echo [on master]
|
2005-12-22 06:39:02 +01:00
|
|
|
connection master;
|
2008-07-07 11:18:09 +02:00
|
|
|
DROP TABLE t1;
|