Debian Codegraph @

mysql-test/suite/rpl/t/rpl_row_img_eng_full_nodup.test

raw
1 #Want to skip this test from daily Valgrind execution
2 --source include/no_valgrind_without_big.inc
3 #
4 # This file contains tests for FULL_NODUP row image mode
5 #
6
7 --let $rpl_topology= 1->2->3
8 --source include/rpl_init.inc
9 -- source include/have_binlog_format_row.inc
10
11 -- connection server_1
12 -- source include/have_innodb.inc
13 -- connection server_2
14 -- source include/have_innodb.inc
15 -- connection server_3
16 -- source include/have_innodb.inc
17 -- connection server_1
18
19 # Tests for different storage engines on each server,
20 # but same index structure on tables. The tests are conducted
21 # using FULL_NODUP binlog-row-image on all servers.
22 #
23
24 -- let $row_img_set=server_1:FULL_NODUP:N,server_2:FULL_NODUP:Y,server_3:FULL_NODUP:Y
25 -- source include/rpl_row_img_set.inc
26
27 -- let $row_img_test_script= include/rpl_row_img.test
28 -- source include/rpl_row_img_general_loop.inc
29
30 ################################################################################
31 # MDEV-33049 Assertion `marked_for_write_or_computed()' failed in bool
32 # Field_new_decimal::store_value(const my_decimal*, int*)
33 #
34 # In FULL_NODUP mode, the before image has all fields and the after image has
35 # only updated fields. Crash happened when slave was unpacking a row event
36 # if the new decimal field is null in the before image.
37 ################################################################################
38 CREATE TABLE t1(c1 INT NOT NULL PRIMARY KEY, c2 varchar(10) DEFAULT NULL,
39 c3 decimal(12,4) DEFAULT NULL);
40 INSERT INTO t1(c1) VALUES (1);
41 --source include/save_master_pos.inc
42 --let $datadir= `SELECT @@datadir`
43
44 # It will generate a row event that c3 is only in before image and it is null.
45 UPDATE t1 SET c2 = 'c2';
46
47 # the UPDATE will crash the slave without this fix.
48 --source include/rpl_sync.inc
49
50 FLUSH BINARY LOGS;
51 UPDATE t1 SET c2 = "c2_new";
52
53 --echo # Use 'BINLOG' statement to apply the first update row event
54 --echo # BINLOG statement is same to slave applier, it should work well.
55 --exec $MYSQL_BINLOG --start-position=$_master_pos $datadir$_master_file > $MYSQLTEST_VARDIR/tmp/binlog.sql
56 --exec $MYSQL < $MYSQLTEST_VARDIR/tmp/binlog.sql
57
58 --echo # After 'BINLOG' statement c2's value should be "c2"
59 SELECT * FROM t1;
60
61 --remove_file $MYSQLTEST_VARDIR/tmp/binlog.sql
62 DROP TABLE t1;
63
64 -- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y
65 -- source include/rpl_row_img_set.inc
66
67 --source include/rpl_end.inc