diff options
Diffstat (limited to 'storage/spider/mysql-test/spider/bugfix/t/mdev_31645.test')
-rw-r--r-- | storage/spider/mysql-test/spider/bugfix/t/mdev_31645.test | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_31645.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_31645.test new file mode 100644 index 00000000..48bfa740 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_31645.test @@ -0,0 +1,35 @@ +--echo # +--echo # MDEV-31645 Spider doesn't recognize semi JOIN +--echo # +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log +set @old_spider_disable_group_by_handler=@@spider_disable_group_by_handler; +set spider_disable_group_by_handler=1; + +evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); + +CREATE TABLE t1 ( a bigint(20) NOT NULL, b bigint(20) DEFAULT 0, PRIMARY KEY (a)); +CREATE TABLE t2 ( a bigint(20) NOT NULL, b bigint(20) DEFAULT 0, PRIMARY KEY (a)) ENGINE=SPIDER COMMENT='srv "srv", WRAPPER "mysql", TABLE "t1"'; + +SET SESSION optimizer_switch='semijoin=off'; +SELECT * FROM t2 +WHERE A BETWEEN 0 AND 10 AND B IN(SELECT B FROM t2 WHERE A BETWEEN 11 AND 20); + +SET SESSION optimizer_switch='semijoin=on'; + +SELECT * FROM t2 +WHERE A BETWEEN 0 AND 10 AND B IN(SELECT B FROM t2 WHERE A BETWEEN 11 AND 20); +drop table t1, t2; +drop server srv; +set spider_disable_group_by_handler=@old_spider_disable_group_by_handler; +--disable_query_log +--disable_result_log +--source ../../t/test_deinit.inc +--enable_result_log +--enable_query_log +--echo # +--echo # end of test mdev_31645 +--echo # |