1
#############################################################################
2
# Original Author: JBM #
3
# Original Date: Aug/18/2005 #
4
# Updated 08/30/2005 Added dumps and diff #
5
#############################################################################
6
#TEST: Taken and modfied from http://bugs.mysql.com/bug.php?id=12480 #
7
#############################################################################
10
-- source include/have_binlog_format_row.inc
11
-- source include/master-slave.inc
14
# Begin clean up test section
17
create database if not exists mysqltest1;
18
DROP TABLE IF EXISTS mysqltest1.t1;
22
# Begin test section 1
23
CREATE TABLE mysqltest1.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT,
24
a TIMESTAMP DEFAULT '2005-05-05 01:01:01',
25
b TIMESTAMP DEFAULT '2005-05-05 01:01:01',
28
CREATE FUNCTION mysqltest1.f1() RETURNS TIMESTAMP
30
DECLARE v1 INT DEFAULT 300;
38
INSERT INTO mysqltest1.t1 VALUES(NULL,NOW(),mysqltest1.f1());
41
CREATE TRIGGER mysqltest1.trig1 BEFORE INSERT ON mysqltest1.t1
43
SET new.b = mysqltest1.f1();
47
INSERT INTO mysqltest1.t1 SET n = NULL, a = now();
49
sync_slave_with_master;
53
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/NOW_master.sql
54
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/NOW_slave.sql
57
DROP TABLE IF EXISTS mysqltest1.t1;
58
DROP FUNCTION mysqltest1.f1;
59
DROP DATABASE mysqltest1;
61
# Lets compare. Note: If they match test will pass, if they do not match
62
# the test will show that the diff statement failed and not reject file
63
# will be created. You will need to go to the mysql-test dir and diff
64
# the files your self to see what is not matching :-) The failed dump
65
# files will be located in $MYSQLTEST_VARDIR/tmp
67
diff_files $MYSQLTEST_VARDIR/tmp/NOW_master.sql $MYSQLTEST_VARDIR/tmp/NOW_slave.sql;
69
# If all is good, when can cleanup our dump files.
70
--remove_file $MYSQLTEST_VARDIR/tmp/NOW_master.sql
71
--remove_file $MYSQLTEST_VARDIR/tmp/NOW_slave.sql
73
sync_slave_with_master;
74
# End of 5.1 test case