-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-22246 Result rows duplicated by spider engine
fix the following type mrr scan (select 0,`id`,`node` from `auto_test_remote`.`tbl_a` where (`id` <> 0) order by `id`)union all(select 1,`id`,`node` from `auto_test_remote`.`tbl_a` where (`id` <> 0) order by `id`) order by `id`
- Loading branch information
Showing
9 changed files
with
335 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
storage/spider/mysql-test/spider/bugfix/include/mdev_22246_deinit.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP | ||
--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP | ||
--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP | ||
--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP | ||
--let $CHILD2_2_DROP_TABLES= $CHILD2_2_DROP_TABLES_BACKUP | ||
--let $CHILD2_2_CREATE_TABLES= $CHILD2_2_CREATE_TABLES_BACKUP | ||
--let $CHILD2_2_SELECT_TABLES= $CHILD2_2_SELECT_TABLES_BACKUP | ||
--disable_warnings | ||
--disable_query_log | ||
--disable_result_log | ||
--source ../t/test_deinit.inc | ||
--enable_result_log | ||
--enable_query_log | ||
--enable_warnings |
48 changes: 48 additions & 0 deletions
48
storage/spider/mysql-test/spider/bugfix/include/mdev_22246_init.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--disable_warnings | ||
--disable_query_log | ||
--disable_result_log | ||
--source ../t/test_init.inc | ||
if (!$HAVE_PARTITION) | ||
{ | ||
--source group_by_order_by_limit_deinit.inc | ||
--enable_result_log | ||
--enable_query_log | ||
--enable_warnings | ||
skip Test requires partitioning; | ||
} | ||
--enable_result_log | ||
--enable_query_log | ||
--enable_warnings | ||
--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1 | ||
let $MASTER_1_COMMENT_2_1= | ||
COMMENT='table "tbl_a"' | ||
PARTITION BY HASH(id) ( | ||
PARTITION pt1 COMMENT='srv "s_2_1"', | ||
PARTITION pt2 COMMENT='srv "s_2_2"' | ||
); | ||
--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES | ||
let $CHILD2_1_DROP_TABLES= | ||
DROP TABLE IF EXISTS tbl_a; | ||
--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES | ||
let $CHILD2_1_CREATE_TABLES= | ||
CREATE TABLE tbl_a ( | ||
id bigint NOT NULL, | ||
node text, | ||
PRIMARY KEY (id) | ||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; | ||
--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES | ||
let $CHILD2_1_SELECT_TABLES= | ||
SELECT * FROM tbl_a ORDER BY id; | ||
--let $CHILD2_2_DROP_TABLES_BACKUP= $CHILD2_2_DROP_TABLES | ||
let $CHILD2_2_DROP_TABLES= | ||
DROP TABLE IF EXISTS tbl_a; | ||
--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES | ||
let $CHILD2_2_CREATE_TABLES= | ||
CREATE TABLE tbl_a ( | ||
id bigint NOT NULL, | ||
node text, | ||
PRIMARY KEY (id) | ||
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; | ||
--let $CHILD2_2_SELECT_TABLES_BACKUP= $CHILD2_2_SELECT_TABLES | ||
let $CHILD2_2_SELECT_TABLES= | ||
SELECT * FROM tbl_a ORDER BY id; |
79 changes: 79 additions & 0 deletions
79
storage/spider/mysql-test/spider/bugfix/r/mdev_22246.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
for master_1 | ||
for child2 | ||
child2_1 | ||
child2_2 | ||
child2_3 | ||
for child3 | ||
|
||
this test is for MDEV-22246 | ||
|
||
drop and create databases | ||
connection master_1; | ||
CREATE DATABASE auto_test_local; | ||
USE auto_test_local; | ||
connection child2_1; | ||
SET @old_log_output = @@global.log_output; | ||
SET GLOBAL log_output = 'TABLE,FILE'; | ||
CREATE DATABASE auto_test_remote; | ||
USE auto_test_remote; | ||
connection child2_2; | ||
SET @old_log_output = @@global.log_output; | ||
SET GLOBAL log_output = 'TABLE,FILE'; | ||
CREATE DATABASE auto_test_remote2; | ||
USE auto_test_remote2; | ||
|
||
create table and insert | ||
connection child2_1; | ||
CHILD2_1_CREATE_TABLES | ||
TRUNCATE TABLE mysql.general_log; | ||
connection child2_2; | ||
CHILD2_2_CREATE_TABLES | ||
TRUNCATE TABLE mysql.general_log; | ||
connection master_1; | ||
CREATE TABLE tbl_a ( | ||
id bigint NOT NULL, | ||
node text, | ||
PRIMARY KEY (id) | ||
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 | ||
INSERT INTO tbl_a (id,node) VALUES (1,'DB-G0'),(2,'DB-G1'); | ||
|
||
select test 1 | ||
connection child2_1; | ||
TRUNCATE TABLE mysql.general_log; | ||
connection child2_2; | ||
TRUNCATE TABLE mysql.general_log; | ||
connection master_1; | ||
SELECT * FROM tbl_a; | ||
id node | ||
2 DB-G1 | ||
1 DB-G0 | ||
SELECT * FROM tbl_a WHERE id != 0; | ||
id node | ||
1 DB-G0 | ||
2 DB-G1 | ||
connection child2_1; | ||
SELECT * FROM tbl_a ORDER BY id; | ||
id node | ||
2 DB-G1 | ||
connection child2_2; | ||
SELECT * FROM tbl_a ORDER BY id; | ||
id node | ||
1 DB-G0 | ||
|
||
deinit | ||
connection master_1; | ||
DROP DATABASE IF EXISTS auto_test_local; | ||
connection child2_1; | ||
DROP DATABASE IF EXISTS auto_test_remote; | ||
SET GLOBAL log_output = @old_log_output; | ||
connection child2_2; | ||
DROP DATABASE IF EXISTS auto_test_remote2; | ||
SET GLOBAL log_output = @old_log_output; | ||
for master_1 | ||
for child2 | ||
child2_1 | ||
child2_2 | ||
child2_3 | ||
for child3 | ||
|
||
end of test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
!include include/default_mysqld.cnf | ||
!include ../my_1_1.cnf | ||
!include ../my_2_1.cnf | ||
!include ../my_2_2.cnf |
Oops, something went wrong.