Skip to content

Commit 75063d1

Browse files
MDEV-30542 Add multilength spider self-reference detection test
1 parent be7ef65 commit 75063d1

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
for master_1
2+
for child2
3+
for child3
4+
5+
MDEV-6268 SPIDER table with no COMMENT clause causes queries to wait forever
6+
7+
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
8+
create table t2 (c int);
9+
create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
10+
create table t0 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"';
11+
alter table t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"';
12+
select * from t0;
13+
ERROR HY000: An infinite loop is detected when opening table test.t0
14+
select * from t1;
15+
ERROR HY000: An infinite loop is detected when opening table test.t0
16+
select * from t2;
17+
ERROR HY000: An infinite loop is detected when opening table test.t0
18+
drop table t0, t1, t2;
19+
for master_1
20+
for child2
21+
for child3
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--disable_query_log
2+
--disable_result_log
3+
--source ../../t/test_init.inc
4+
--enable_result_log
5+
--enable_query_log
6+
7+
--echo
8+
--echo MDEV-6268 SPIDER table with no COMMENT clause causes queries to wait forever
9+
--echo
10+
11+
--replace_regex /SOCKET ".*"/SOCKET "$MASTER_1_MYSOCK"/
12+
eval CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
13+
create table t2 (c int);
14+
create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
15+
create table t0 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"';
16+
alter table t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"';
17+
--error 12719
18+
select * from t0;
19+
--error 12719
20+
select * from t1;
21+
--error 12719
22+
select * from t2;
23+
drop table t0, t1, t2;
24+
25+
--disable_query_log
26+
--disable_result_log
27+
--source ../../t/test_deinit.inc
28+
--enable_result_log
29+
--enable_query_log

0 commit comments

Comments
 (0)