-
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-21884 MariaDB with Spider crashes on a query
- Loading branch information
Showing
6 changed files
with
293 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
storage/spider/mysql-test/spider/bugfix/include/mdev_21884_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 | ||
--connection master_1 | ||
set session spider_bgs_mode= @old_spider_bgs_mode; | ||
set session spider_quick_mode= @old_spider_quick_mode; | ||
--disable_warnings | ||
--disable_query_log | ||
--disable_result_log | ||
--source ../t/test_deinit.inc | ||
--enable_result_log | ||
--enable_query_log | ||
--enable_warnings |
57 changes: 57 additions & 0 deletions
57
storage/spider/mysql-test/spider/bugfix/include/mdev_21884_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,57 @@ | ||
--disable_warnings | ||
--disable_query_log | ||
--disable_result_log | ||
--source ../t/test_init.inc | ||
--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", srv "s_2_1"'; | ||
--let $MASTER_1_COMMENT_P_2_1_BACKUP= $MASTER_1_COMMENT_P_2_1 | ||
let $MASTER_1_COMMENT_P_2_1= | ||
COMMENT='table "ta_r3"' | ||
PARTITION BY RANGE(a) ( | ||
PARTITION pt1 VALUES LESS THAN (10) COMMENT='srv "s_2_1", table "ta_r2", | ||
priority "1000"', | ||
PARTITION pt2 VALUES LESS THAN MAXVALUE COMMENT='srv "s_2_1", priority "1000001"' | ||
); | ||
--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES | ||
let $CHILD2_1_DROP_TABLES= | ||
DROP TABLE IF EXISTS tbl_a; | ||
let $CHILD2_1_DROP_TABLES= | ||
DROP TABLE IF EXISTS ta_r2 $STR_SEMICOLON | ||
DROP TABLE IF EXISTS ta_r3; | ||
--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES | ||
let $CHILD2_1_CREATE_TABLES= | ||
CREATE TABLE tbl_a ( | ||
pkey int NOT NULL, | ||
txt char(8) NOT NULL, | ||
PRIMARY KEY (pkey, txt) | ||
) $CHILD2_1_ENGINE DEFAULT CHARACTER SET utf8; | ||
let $CHILD2_1_CREATE_TABLES= | ||
CREATE TABLE ta_r2 ( | ||
a INT, | ||
b CHAR(1), | ||
c DATETIME, | ||
PRIMARY KEY(a,b) | ||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET $STR_SEMICOLON | ||
CREATE TABLE ta_r3 ( | ||
a INT, | ||
b CHAR(1), | ||
c DATETIME, | ||
PRIMARY KEY(a,b) | ||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; | ||
--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES | ||
let $CHILD2_1_SELECT_TABLES= | ||
SELECT pkey, txt FROM tbl_a ORDER BY pkey; | ||
let $CHILD2_1_SELECT_TABLES= | ||
SELECT a, b, c FROM ta_r2 ORDER BY a $STR_SEMICOLON | ||
SELECT a, b, c FROM ta_r3 ORDER BY a; | ||
let $CHILD2_1_SELECT_ARGUMENT1= | ||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; | ||
--connection master_1 | ||
set @old_spider_bgs_mode= @@spider_bgs_mode; | ||
set session spider_bgs_mode= 2; | ||
set @old_spider_quick_mode= @@spider_quick_mode; | ||
set session spider_quick_mode= 3; |
107 changes: 107 additions & 0 deletions
107
storage/spider/mysql-test/spider/bugfix/r/mdev_21884.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,107 @@ | ||
for master_1 | ||
for child2 | ||
child2_1 | ||
child2_2 | ||
child2_3 | ||
for child3 | ||
connection master_1; | ||
set @old_spider_bgs_mode= @@spider_bgs_mode; | ||
set session spider_bgs_mode= 2; | ||
set @old_spider_quick_mode= @@spider_quick_mode; | ||
set session spider_quick_mode= 3; | ||
|
||
this test is for MDEV-21884 | ||
|
||
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; | ||
|
||
create table and insert | ||
connection child2_1; | ||
CHILD2_1_CREATE_TABLES | ||
TRUNCATE TABLE mysql.general_log; | ||
connection master_1; | ||
CREATE TABLE tbl_a ( | ||
a INT, | ||
b CHAR(1), | ||
c DATETIME, | ||
PRIMARY KEY(a,b) | ||
) ENGINE=Spider COMMENT='table "ta_r3"' | ||
PARTITION BY RANGE(a) ( | ||
PARTITION pt1 VALUES LESS THAN (10) COMMENT='srv "s_2_1", table "ta_r2", | ||
priority "1000"', | ||
PARTITION pt2 VALUES LESS THAN MAXVALUE COMMENT='srv "s_2_1", priority "1000001"' | ||
) | ||
CREATE TABLE tb_l ( | ||
a INT, | ||
b CHAR(1), | ||
c DATETIME, | ||
PRIMARY KEY(a) | ||
) MASTER_1_ENGINE2 MASTER_1_CHARSET2 | ||
INSERT INTO tbl_a (a, b, c) VALUES | ||
(11, 'a', '2008-08-01 10:21:39'), | ||
(11, 'b', '2000-01-01 00:00:00'), | ||
(12, 'e', '2007-06-04 20:03:11'), | ||
(12, 'd', '2003-11-30 05:01:03'), | ||
(13, 'c', '2001-12-31 23:59:59'); | ||
INSERT INTO tb_l (a, b, c) VALUES | ||
(11, 'a', '2008-08-01 10:21:39'), | ||
(12, 'b', '2000-01-01 00:00:00'), | ||
(13, 'e', '2007-06-04 20:03:11'), | ||
(14, 'd', '2003-11-30 05:01:03'), | ||
(15, 'c', '2001-12-31 23:59:59'); | ||
|
||
test 1 | ||
connection child2_1; | ||
TRUNCATE TABLE mysql.general_log; | ||
connection master_1; | ||
SELECT STRAIGHT_JOIN b.a, b.b FROM tb_l a, tbl_a b WHERE a.a = b.a; | ||
a b | ||
11 a | ||
11 b | ||
12 d | ||
12 e | ||
13 c | ||
connection child2_1; | ||
SET NAMES utf8; | ||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; | ||
argument | ||
select `a`,`b` from `auto_test_remote`.`ta_r3` where `a` = 11 order by `b` | ||
select `a`,`b` from `auto_test_remote`.`ta_r3` where `a` = 12 order by `b` | ||
select `a`,`b` from `auto_test_remote`.`ta_r3` where `a` = 13 order by `b` | ||
select `a`,`b` from `auto_test_remote`.`ta_r3` where `a` = 14 order by `b` | ||
select `a`,`b` from `auto_test_remote`.`ta_r3` where `a` = 15 order by `b` | ||
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' | ||
SELECT a, b, c FROM ta_r2 ORDER BY a ; | ||
SELECT a, b, c FROM ta_r3 ORDER BY a; | ||
a b c | ||
a b c | ||
11 a 2008-08-01 10:21:39 | ||
11 b 2000-01-01 00:00:00 | ||
12 d 2003-11-30 05:01:03 | ||
12 e 2007-06-04 20:03:11 | ||
13 c 2001-12-31 23:59:59 | ||
|
||
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 master_1; | ||
set session spider_bgs_mode= @old_spider_bgs_mode; | ||
set session spider_quick_mode= @old_spider_quick_mode; | ||
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,3 @@ | ||
!include include/default_mysqld.cnf | ||
!include ../my_1_1.cnf | ||
!include ../my_2_1.cnf |
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,97 @@ | ||
--source ../include/mdev_21884_init.inc | ||
--echo | ||
--echo this test is for MDEV-21884 | ||
--echo | ||
--echo drop and create databases | ||
|
||
--connection master_1 | ||
--disable_warnings | ||
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; | ||
--enable_warnings | ||
|
||
--echo | ||
--echo create table and insert | ||
|
||
--connection child2_1 | ||
--disable_query_log | ||
echo CHILD2_1_CREATE_TABLES; | ||
eval $CHILD2_1_CREATE_TABLES; | ||
--enable_query_log | ||
TRUNCATE TABLE mysql.general_log; | ||
|
||
--connection master_1 | ||
--disable_query_log | ||
echo CREATE TABLE tbl_a ( | ||
a INT, | ||
b CHAR(1), | ||
c DATETIME, | ||
PRIMARY KEY(a,b) | ||
) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; | ||
eval CREATE TABLE tbl_a ( | ||
a INT, | ||
b CHAR(1), | ||
c DATETIME, | ||
PRIMARY KEY(a,b) | ||
) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; | ||
echo CREATE TABLE tb_l ( | ||
a INT, | ||
b CHAR(1), | ||
c DATETIME, | ||
PRIMARY KEY(a) | ||
) MASTER_1_ENGINE2 MASTER_1_CHARSET2; | ||
eval CREATE TABLE tb_l ( | ||
a INT, | ||
b CHAR(1), | ||
c DATETIME, | ||
PRIMARY KEY(a) | ||
) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; | ||
--enable_query_log | ||
INSERT INTO tbl_a (a, b, c) VALUES | ||
(11, 'a', '2008-08-01 10:21:39'), | ||
(11, 'b', '2000-01-01 00:00:00'), | ||
(12, 'e', '2007-06-04 20:03:11'), | ||
(12, 'd', '2003-11-30 05:01:03'), | ||
(13, 'c', '2001-12-31 23:59:59'); | ||
INSERT INTO tb_l (a, b, c) VALUES | ||
(11, 'a', '2008-08-01 10:21:39'), | ||
(12, 'b', '2000-01-01 00:00:00'), | ||
(13, 'e', '2007-06-04 20:03:11'), | ||
(14, 'd', '2003-11-30 05:01:03'), | ||
(15, 'c', '2001-12-31 23:59:59'); | ||
|
||
--echo | ||
--echo test 1 | ||
|
||
--connection child2_1 | ||
TRUNCATE TABLE mysql.general_log; | ||
|
||
--connection master_1 | ||
SELECT STRAIGHT_JOIN b.a, b.b FROM tb_l a, tbl_a b WHERE a.a = b.a; | ||
|
||
--connection child2_1 | ||
SET NAMES utf8; | ||
eval $CHILD2_1_SELECT_ARGUMENT1; | ||
eval $CHILD2_1_SELECT_TABLES; | ||
|
||
--echo | ||
--echo deinit | ||
--disable_warnings | ||
|
||
--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; | ||
|
||
--enable_warnings | ||
--source ../include/mdev_21884_deinit.inc | ||
--echo | ||
--echo 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