~stewart/drizzle/embedded-innodb-create-select-transaction-arrgh

« back to all changes in this revision

Viewing changes to mysql-test/extra/rpl_tests/rpl_row_UUID.test

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#############################################################################
 
2
# Original Author: JBM                                                      #
 
3
# Original Date: Aug/18/2005                                                #
 
4
#############################################################################
 
5
# TEST: To test the UUID() in rbr                                           #
 
6
#############################################################################
 
7
 
 
8
# Begin clean up test section
 
9
connection master;
 
10
 
 
11
--disable_warnings
 
12
DROP PROCEDURE IF EXISTS test.p1;
 
13
DROP TABLE IF EXISTS test.t1;
 
14
--enable_warnings
 
15
 
 
16
# Section 1 test 
 
17
 
 
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());
 
20
delimiter |;
 
21
create procedure test.p1()
 
22
begin
 
23
  INSERT INTO test.t1  VALUES(2,UUID(),UUID());
 
24
  INSERT INTO test.t1  VALUES(3,UUID(),UUID());
 
25
end|
 
26
delimiter ;|
 
27
 
 
28
CALL test.p1();
 
29
 
 
30
# Now the same thing with a function
 
31
 
 
32
delimiter |;
 
33
create function test.fn1(x int)
 
34
       returns int
 
35
begin
 
36
       insert into t1 values (4+x,UUID(),UUID());
 
37
       insert into t1 values (5+x,UUID(),UUID());
 
38
       return 0;
 
39
end|
 
40
 
 
41
delimiter ;|
 
42
# test both in SELECT and in INSERT
 
43
select fn1(0);
 
44
eval create table t2 (a int) engine=$engine_type;
 
45
insert into t2 values(fn1(2));
 
46
 
 
47
sync_slave_with_master;
 
48
SHOW CREATE TABLE test.t1;
 
49
 
 
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 $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_master.sql
 
56
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_slave.sql
 
57
 
 
58
connection master;
 
59
# Let's cleanup
 
60
 
 
61
DROP PROCEDURE test.p1;
 
62
DROP FUNCTION test.fn1;
 
63
DROP TABLE test.t1;
 
64
DROP TABLE test.t2;
 
65
 
 
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 :-)
 
70
 
 
71
diff_files $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_master.sql $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_slave.sql;
 
72
 
 
73
# Cleanup dump files.
 
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.
 
77
 
 
78
# End of 5.0 test case
 
79
-- source include/master-slave-end.inc