|
| 1 | +--source include/have_binlog_format_row.inc |
| 2 | +--source include/master-slave.inc |
| 3 | + |
| 4 | +--echo # |
| 5 | +--echo # MDEV-32637 Implement native UUID7 function |
| 6 | +--echo # |
| 7 | + |
| 8 | +connection master; |
| 9 | + |
| 10 | +# Start the actual test |
| 11 | + |
| 12 | +CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, vchar_column VARCHAR(100), PRIMARY KEY(a)) engine=myisam; |
| 13 | +INSERT INTO test.t1 VALUES(1,UUIDv7(),UUIDv7()); |
| 14 | +delimiter |; |
| 15 | +create procedure test.p1() |
| 16 | +begin |
| 17 | + INSERT INTO test.t1 VALUES(2,UUIDv7(),UUIDv7()); |
| 18 | + INSERT INTO test.t1 VALUES(3,UUIDv7(),UUIDv7()); |
| 19 | +end| |
| 20 | +delimiter ;| |
| 21 | + |
| 22 | +CALL test.p1(); |
| 23 | + |
| 24 | +delimiter |; |
| 25 | +create function test.fn1(x int) |
| 26 | + returns int |
| 27 | +begin |
| 28 | + insert into t1 values (4+x,UUIDv7(),UUIDv7()); |
| 29 | + insert into t1 values (5+x,UUIDv7(),UUIDv7()); |
| 30 | + return 0; |
| 31 | +end| |
| 32 | + |
| 33 | +delimiter ;| |
| 34 | +# test both in SELECT and in INSERT |
| 35 | +--disable_ps2_protocol |
| 36 | +select fn1(0); |
| 37 | +--enable_ps2_protocol |
| 38 | +create table t2 (a int) engine=myisam; |
| 39 | +insert into t2 values(fn1(2)); |
| 40 | + |
| 41 | +sync_slave_with_master; |
| 42 | +SHOW CREATE TABLE test.t1; |
| 43 | + |
| 44 | +# Dump the databases and so we can see if they match |
| 45 | +# Another method would be to use SELECT INTO OUTFILE on master, |
| 46 | +# then LOAD DATA INFILE in slave, and use a query to compare. |
| 47 | +# This would have the advantage that it would not assume |
| 48 | +# the system has a 'diff' |
| 49 | +--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_row_UUIDv7_master.sql |
| 50 | +--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_row_UUIDv7_slave.sql |
| 51 | + |
| 52 | +connection master; |
| 53 | + |
| 54 | +DROP PROCEDURE test.p1; |
| 55 | +DROP FUNCTION test.fn1; |
| 56 | +DROP TABLE test.t1; |
| 57 | +DROP TABLE test.t2; |
| 58 | + |
| 59 | +# Let's compare. Note: If they match test will pass, if they do not match |
| 60 | +# the test will show that the diff statement failed and not reject file |
| 61 | +# will be created. You will need to go to the mysql-test dir and diff |
| 62 | +# the files your self to see what is not matching :-) |
| 63 | + |
| 64 | +diff_files $MYSQLTEST_VARDIR/tmp/rpl_row_UUIDv7_master.sql $MYSQLTEST_VARDIR/tmp/rpl_row_UUIDv7_slave.sql; |
| 65 | + |
| 66 | +remove_file $MYSQLTEST_VARDIR/tmp/rpl_row_UUIDv7_master.sql; |
| 67 | +remove_file $MYSQLTEST_VARDIR/tmp/rpl_row_UUIDv7_slave.sql; |
| 68 | + |
| 69 | +--echo # End of 11.7 tests |
| 70 | + |
| 71 | +--source include/rpl_end.inc |
0 commit comments