1
#############################################################################
2
# Original Author: JBM #
3
# Original Date: Aug/18/2005 #
4
#############################################################################
5
# TEST: To test the UUID() in rbr #
6
#############################################################################
8
# Begin clean up test section
12
DROP PROCEDURE IF EXISTS test.p1;
13
DROP TABLE IF EXISTS test.t1;
18
eval CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, vchar_column VARCHAR(100), PRIMARY KEY(a)) engine=$engine_type;
19
INSERT INTO test.t1 VALUES(1,UUID(),UUID());
21
create procedure test.p1()
23
INSERT INTO test.t1 VALUES(2,UUID(),UUID());
24
INSERT INTO test.t1 VALUES(3,UUID(),UUID());
30
# Now the same thing with a function
33
create function test.fn1(x int)
36
insert into t1 values (4+x,UUID(),UUID());
37
insert into t1 values (5+x,UUID(),UUID());
42
# test both in SELECT and in INSERT
44
eval create table t2 (a int) engine=$engine_type;
45
insert into t2 values(fn1(2));
47
sync_slave_with_master;
48
SHOW CREATE TABLE test.t1;
50
# Dump the databases and so we can see if they match
51
# Another method would be to use SELECT INTO OUTFILE on master,
52
# then LOAD DATA INFILE in slave, and use a query to compare.
53
# This would have the advantage that it would not assume
54
# the system has a 'diff'
55
--exec $DRIZZLE_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_master.sql
56
--exec $DRIZZLE_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_slave.sql
61
DROP PROCEDURE test.p1;
62
DROP FUNCTION test.fn1;
66
# Let's compare. Note: If they match test will pass, if they do not match
67
# the test will show that the diff statement failed and not reject file
68
# will be created. You will need to go to the mysql-test dir and diff
69
# the files your self to see what is not matching :-)
71
diff_files $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_master.sql $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_slave.sql;
74
# Long-term "system rm" is not portable; we could live without
75
# this cleanup as no other test will use these files and they'll
76
# be removed at next testsuite run.
78
# End of 5.0 test case