File: rpl_create_or_replace_fail.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 (56 lines) | stat: -rw-r--r-- 1,926 bytes parent folder | download | duplicates (5)
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
# ==== Purpose ====
#
# Test verifies that failed CREATE OR REPLACE TEMPORARY TABLE statement which
# dropped the table but failed at a later stage of creation of temporary table
# is written to binarylog in row based replication.
#
# ==== Implementation ====
#
# Steps:
#    0 - Have mixed based replication mode.
#    1 - Create a temporary table. It will be replicated as mixed replication
#        mode is in use.
#    2 - Execute an unsafe statement which will switch current statement
#        binlog format to 'ROW'. i.e If binlog_format=MIXED, there are open
#        temporary tables, and an unsafe statement is executed, then subsequent
#        statements are logged in row format.
#    3 - Execute a CREATE OR REPLACE TEMPORARY TABLE statement which tries to
#        create partitions on temporary table. Since it is not supported it will
#        fail.
#    4 - Check the binary log output to ensure that the failed statement is
#        written to the binary log.
#    5 - Slave should be up and running and in sync with master.
#
# ==== References ====
#
# MDEV-18930: Failed CREATE OR REPLACE TEMPORARY not written into binary log
# makes data on master and slave diverge
#

--source include/have_partition.inc
--source include/have_binlog_format_mixed.inc
--source include/master-slave.inc

CREATE TEMPORARY TABLE t1 (a INT NOT NULL);

# Execute an unsafe statement which switches replication mode internally from
# "STATEMENT" to "ROW".
--error ER_NO_SUCH_TABLE
LOAD DATA INFILE 'x' INTO TABLE x;

--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
CREATE OR REPLACE TEMPORARY TABLE t1 (x INT) PARTITION BY HASH(x);

--echo "************** DROP TEMPORARY TABLE Should be present in Binary log **************"
--source include/show_binlog_events.inc

CREATE TABLE t1 (b INT);
INSERT INTO t1 VALUES (NULL);
--sync_slave_with_master

# Cleanup
--connection master
DROP TABLE t1;

--source include/rpl_end.inc