File: rpl_row.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (77 lines) | stat: -rw-r--r-- 2,330 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
--source include/have_binlog_format_row.inc
--source include/master-slave.inc
--source include/have_innodb.inc
--source suite/versioning/sys_time.inc

--echo # MDEV-16252: MINIMAL binlog_row_image does not work for versioned tables
set @old_row_image= @@binlog_row_image;
set binlog_row_image= minimal;

create or replace table t1 (pk int, i int, primary key(pk))
with system versioning;
insert into t1 values (1,10),(2,20);
update t1 set i = 0;

--sync_slave_with_master
--connection master
drop table t1;
set binlog_row_image= @old_row_image;

--echo #
--echo # MDEV-28254 Wrong position for row_start, row_end after adding column
--echo #            to implicit versioned table
--echo #
--let TMP= $MYSQLTEST_VARDIR/tmp
--let $MYSQLD_DATADIR= `select @@datadir`
set @@system_versioning_alter_history= keep;
set @@session.time_zone='+00:00';

create table t1 (x int) with system versioning engine innodb;
alter table t1 add column y int, algorithm=inplace;
check table t1;
--exec $MYSQL_DUMP --databases test > $TMP/dump.sql

--sync_slave_with_master
drop table t1;
--exec $MYSQL_SLAVE test < $TMP/dump.sql
show create table t1;

--connection master
set timestamp= 12345;
--let $start_pos= query_get_value("SHOW MASTER STATUS", Position, 1)
insert t1 values (1, 1);
--replace_result $sys_timestamp_max TIMESTAMP_MAX
select *, unix_timestamp(row_start) as row_start, unix_timestamp(row_end) as row_end from t1;
--let $stop_pos= query_get_value("SHOW MASTER STATUS", Position, 1)
set timestamp= default;

# NOTE: pipe grep is not Windows-compatible
--let grep_file= $TMP/out.txt
--let grep_regex= ^###
--let grep_filter=s{$sys_timestamp_max}{MAX_TIMESTAMP};
--exec $MYSQL_BINLOG -v -j $start_pos --stop-position=$stop_pos -o 3 $MYSQLD_DATADIR/master-bin.000001 > $grep_file
--source include/grep.inc
--sync_slave_with_master
select * from t1;

--connection master
drop table t1;
--remove_files_wildcard $TMP *.txt
--remove_files_wildcard $TMP *.sql

--echo #
--echo # MDEV-31297 Create table as select on system versioned tables do not work consistently on replication
--echo #
--connection master
create table t engine=innodb with system versioning as select 1 as i;
show create table t;
select * from t;

--sync_slave_with_master
show create table t;
select * from t;

--connection master
drop table t;

--source rpl_common.inc