From 75063d128812347228873e2dce4ae7799f348ebf Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Tue, 4 Apr 2023 15:54:26 +1000 Subject: MDEV-30542 Add multilength spider self-reference detection test --- .../spider/bugfix/r/self_reference_multi.result | 21 ++++++++++++++++ .../spider/bugfix/t/self_reference_multi.test | 29 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result create mode 100644 storage/spider/mysql-test/spider/bugfix/t/self_reference_multi.test diff --git a/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result b/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result new file mode 100644 index 00000000000..c4399ddf9d2 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result @@ -0,0 +1,21 @@ +for master_1 +for child2 +for child3 + +MDEV-6268 SPIDER table with no COMMENT clause causes queries to wait forever + +CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); +create table t2 (c int); +create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"'; +create table t0 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"'; +alter table t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"'; +select * from t0; +ERROR HY000: An infinite loop is detected when opening table test.t0 +select * from t1; +ERROR HY000: An infinite loop is detected when opening table test.t0 +select * from t2; +ERROR HY000: An infinite loop is detected when opening table test.t0 +drop table t0, t1, t2; +for master_1 +for child2 +for child3 diff --git a/storage/spider/mysql-test/spider/bugfix/t/self_reference_multi.test b/storage/spider/mysql-test/spider/bugfix/t/self_reference_multi.test new file mode 100644 index 00000000000..8b6f070d167 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/self_reference_multi.test @@ -0,0 +1,29 @@ +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log + +--echo +--echo MDEV-6268 SPIDER table with no COMMENT clause causes queries to wait forever +--echo + +--replace_regex /SOCKET ".*"/SOCKET "$MASTER_1_MYSOCK"/ +eval CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); +create table t2 (c int); +create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"'; +create table t0 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"'; +alter table t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"'; +--error 12719 +select * from t0; +--error 12719 +select * from t1; +--error 12719 +select * from t2; +drop table t0, t1, t2; + +--disable_query_log +--disable_result_log +--source ../../t/test_deinit.inc +--enable_result_log +--enable_query_log -- cgit v1.2.1