Skip to content

Commit dc588e3

Browse files
committed
Merge remote-tracking branch 'origin/10.3' into 10.4
2 parents f1dcbc2 + 7e44c45 commit dc588e3

26 files changed

+433
-120
lines changed

mysql-test/main/func_json.result

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,18 @@ SELECT json_valid('{"test": "\\ud83d\\ude0b"}');
951951
json_valid('{"test": "\\ud83d\\ude0b"}')
952952
1
953953
#
954+
# MDEV-19670 json escaped unicode parse error
955+
#
956+
SELECT JSON_VALID('{"admin\\"": null}'), '{"admin\\"": null}'
957+
UNION
958+
SELECT JSON_VALID('{"\\"admin": null}'), '{"\\"admin": null}'
959+
UNION
960+
SELECT JSON_VALID('{"\\"": null}'), '{"\\"": null}';
961+
JSON_VALID('{"admin\\"": null}') {"admin\"": null}
962+
1 {"admin\"": null}
963+
1 {"\"admin": null}
964+
1 {"\"": null}
965+
#
954966
# End of 10.3 tests
955967
#
956968
#

mysql-test/main/func_json.test

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,16 @@ SELECT
568568
SELECT json_valid('{"value":"\\ud83d\\ude0a"}');
569569
SELECT json_valid('{"test": "\\ud83d\\ude0b"}');
570570

571+
--echo #
572+
--echo # MDEV-19670 json escaped unicode parse error
573+
--echo #
574+
575+
SELECT JSON_VALID('{"admin\\"": null}'), '{"admin\\"": null}'
576+
UNION
577+
SELECT JSON_VALID('{"\\"admin": null}'), '{"\\"admin": null}'
578+
UNION
579+
SELECT JSON_VALID('{"\\"": null}'), '{"\\"": null}';
580+
571581
--echo #
572582
--echo # End of 10.3 tests
573583
--echo #

mysql-test/main/myisam.result

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2682,3 +2682,26 @@ myisam_block_size 1024
26822682
select @@global.myisam_block_size;
26832683
@@global.myisam_block_size
26842684
1024
2685+
#
2686+
# MDEV-20704 An index on a double column erroneously uses prefix compression
2687+
#
2688+
CREATE TABLE t1 (
2689+
id INT NOT NULL PRIMARY KEY,
2690+
d DOUBLE,
2691+
KEY (d)
2692+
) ENGINE=MyISAM;
2693+
2694+
MyISAM file: MYSQLD_DATADIR/test/t1
2695+
Record format: Fixed length
2696+
Character set: latin1_swedish_ci (8)
2697+
Data records: 0 Deleted blocks: 0
2698+
Recordlength: 13
2699+
2700+
table description:
2701+
Key Start Len Index Type
2702+
1 2 4 unique long
2703+
2 6 8 multip. double NULL
2704+
DROP TABLE t1;
2705+
#
2706+
# End of 5.5 tests
2707+
#

mysql-test/main/myisam.test

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,3 +1810,22 @@ drop table t1;
18101810
#
18111811
show variables like 'myisam_block_size';
18121812
select @@global.myisam_block_size;
1813+
1814+
1815+
--echo #
1816+
--echo # MDEV-20704 An index on a double column erroneously uses prefix compression
1817+
--echo #
1818+
1819+
CREATE TABLE t1 (
1820+
id INT NOT NULL PRIMARY KEY,
1821+
d DOUBLE,
1822+
KEY (d)
1823+
) ENGINE=MyISAM;
1824+
let $MYSQLD_DATADIR= `select @@datadir`;
1825+
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
1826+
--exec $MYISAMCHK -d $MYSQLD_DATADIR/test/t1
1827+
DROP TABLE t1;
1828+
1829+
--echo #
1830+
--echo # End of 5.5 tests
1831+
--echo #

mysql-test/main/rowid_filter.result

Lines changed: 69 additions & 69 deletions
Large diffs are not rendered by default.

mysql-test/main/stat_tables.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,9 @@ from part, lineitem, orders
335335
where p_retailprice > 1100 and o_orderdate='1997-01-01'
336336
and o_orderkey=l_orderkey and p_partkey=l_partkey;
337337
id select_type table type possible_keys key key_len ref rows Extra
338+
1 SIMPLE part range PRIMARY,i_p_retailprice i_p_retailprice 9 NULL 1 Using index condition
338339
1 SIMPLE orders ref PRIMARY,i_o_orderdate i_o_orderdate 4 const 1
339340
1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
340-
1 SIMPLE part eq_ref|filter PRIMARY,i_p_retailprice PRIMARY|i_p_retailprice 4|9 dbt3_s001.lineitem.l_partkey 1 (1%) Using where; Using rowid filter
341341
select o_orderkey, p_partkey
342342
from part, lineitem, orders
343343
where p_retailprice > 1100 and o_orderdate='1997-01-01'
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
include/master-slave.inc
2+
[connection master]
3+
connection server_2;
4+
include/stop_slave.inc
5+
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
6+
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
7+
SET @old_dbug= @@GLOBAL.debug_dbug;
8+
SET GLOBAL slave_parallel_mode='optimistic';
9+
SET GLOBAL slave_parallel_threads= 3;
10+
CHANGE MASTER TO master_use_gtid=slave_pos;
11+
CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");
12+
include/start_slave.inc
13+
connection server_1;
14+
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
15+
CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=InnoDB;
16+
include/save_master_gtid.inc
17+
connection server_2;
18+
include/sync_with_master_gtid.inc
19+
connect con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
20+
BEGIN;
21+
INSERT INTO t1 VALUES (32);
22+
connection server_1;
23+
INSERT INTO t1 VALUES (32);
24+
connection server_2;
25+
SET GLOBAL debug_dbug="+d,hold_worker_on_schedule";
26+
SET debug_sync="debug_sync_action SIGNAL reached_pause WAIT_FOR continue_worker";
27+
connection server_1;
28+
SET gtid_seq_no=100;
29+
INSERT INTO t1 VALUES (33);
30+
connection server_2;
31+
SET debug_sync='now WAIT_FOR reached_pause';
32+
connection server_1;
33+
INSERT INTO t1 VALUES (34);
34+
connection server_2;
35+
connection con_temp2;
36+
COMMIT;
37+
connection server_2;
38+
include/stop_slave.inc
39+
include/assert.inc [table t1 should have zero rows where a>32]
40+
SELECT * FROM t1 WHERE a>32;
41+
a
42+
DELETE FROM t1 WHERE a=32;
43+
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
44+
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
45+
SET GLOBAL debug_dbug=@old_debug;
46+
SET DEBUG_SYNC= 'RESET';
47+
include/start_slave.inc
48+
connection server_1;
49+
DROP TABLE t1;
50+
include/rpl_end.inc
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--source suite/rpl/include/rpl_parallel_ignored_errors.inc

mysql-test/suite/json/r/json_no_table.result

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# ==== Purpose ====
2+
#
3+
# Test verifies that, in parallel replication, transaction failure notification
4+
# is propagated to all the workers. Workers should abort the execution of
5+
# transaction event groups, whose event positions are higher than the failing
6+
# transaction group.
7+
#
8+
# ==== Implementation ====
9+
#
10+
# Steps:
11+
# 0 - Create a table t1 on master which has a primary key. Enable parallel
12+
# replication on slave with slave_parallel_mode='optimistic' and
13+
# slave_parallel_threads=3.
14+
# 1 - On slave start a transaction and execute a local INSERT statement
15+
# which will insert value 32. This is done to block the INSERT coming
16+
# from master.
17+
# 2 - On master execute an INSERT statement with value 32, so that it is
18+
# blocked on slave.
19+
# 3 - On slave enable a debug sync point such that it holds the worker thread
20+
# execution as soon as work is scheduled to it.
21+
# 4 - INSERT value 33 on master. It will be held on slave by other worker
22+
# thread due to debug simulation.
23+
# 5 - INSERT value 34 on master.
24+
# 6 - On slave, enusre that INSERT 34 has reached a state where it waits for
25+
# its prior transactions to commit.
26+
# 7 - Commit the local INSERT 32 on slave server so that first worker will
27+
# error out.
28+
# 8 - Now send a continue signal to second worker processing 33. It should
29+
# wakeup and propagate the error to INSERT 34.
30+
# 9 - Upon slave stop due to error, check that no rows are found after the
31+
# failed INSERT 32.
32+
#
33+
# ==== References ====
34+
#
35+
# MDEV-20645: Replication consistency is broken as workers miss the error
36+
# notification from an earlier failed group.
37+
#
38+
39+
--source include/have_innodb.inc
40+
--source include/have_debug.inc
41+
--source include/have_debug_sync.inc
42+
--source include/have_binlog_format_statement.inc
43+
--source include/master-slave.inc
44+
45+
--enable_connect_log
46+
--connection server_2
47+
--source include/stop_slave.inc
48+
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
49+
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
50+
SET @old_dbug= @@GLOBAL.debug_dbug;
51+
SET GLOBAL slave_parallel_mode='optimistic';
52+
SET GLOBAL slave_parallel_threads= 3;
53+
CHANGE MASTER TO master_use_gtid=slave_pos;
54+
CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");
55+
--source include/start_slave.inc
56+
57+
--connection server_1
58+
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
59+
CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=InnoDB;
60+
--source include/save_master_gtid.inc
61+
62+
--connection server_2
63+
--source include/sync_with_master_gtid.inc
64+
65+
--connect (con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
66+
BEGIN;
67+
INSERT INTO t1 VALUES (32);
68+
69+
--connection server_1
70+
INSERT INTO t1 VALUES (32);
71+
72+
--connection server_2
73+
--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE info like "INSERT INTO t1 VALUES (32)"
74+
--source include/wait_condition.inc
75+
SET GLOBAL debug_dbug="+d,hold_worker_on_schedule";
76+
SET debug_sync="debug_sync_action SIGNAL reached_pause WAIT_FOR continue_worker";
77+
78+
--connection server_1
79+
SET gtid_seq_no=100;
80+
INSERT INTO t1 VALUES (33);
81+
82+
--connection server_2
83+
SET debug_sync='now WAIT_FOR reached_pause';
84+
85+
--connection server_1
86+
INSERT INTO t1 VALUES (34);
87+
88+
--connection server_2
89+
--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state like "Waiting for prior transaction to commit"
90+
--source include/wait_condition.inc
91+
--connection con_temp2
92+
COMMIT;
93+
94+
# Clean up.
95+
--connection server_2
96+
--source include/stop_slave.inc
97+
--let $assert_cond= COUNT(*) = 0 FROM t1 WHERE a>32
98+
--let $assert_text= table t1 should have zero rows where a>32
99+
--source include/assert.inc
100+
SELECT * FROM t1 WHERE a>32;
101+
DELETE FROM t1 WHERE a=32;
102+
103+
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
104+
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
105+
SET GLOBAL debug_dbug=@old_debug;
106+
SET DEBUG_SYNC= 'RESET';
107+
--source include/start_slave.inc
108+
109+
--connection server_1
110+
DROP TABLE t1;
111+
--disable_connect_log
112+
--source include/rpl_end.inc

0 commit comments

Comments
 (0)