diff options
5 files changed, 116 insertions, 0 deletions
diff --git a/storage/spider/mysql-test/spider/bugfix/include/mdev_26247_deinit.inc b/storage/spider/mysql-test/spider/bugfix/include/mdev_26247_deinit.inc new file mode 100644 index 00000000000..9b8492ef548 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/mdev_26247_deinit.inc @@ -0,0 +1,5 @@ +--disable_query_log +--disable_result_log +--source ../../t/test_deinit.inc +--enable_result_log +--enable_query_log diff --git a/storage/spider/mysql-test/spider/bugfix/include/mdev_26247_init.inc b/storage/spider/mysql-test/spider/bugfix/include/mdev_26247_init.inc new file mode 100644 index 00000000000..a3e0998e81d --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/mdev_26247_init.inc @@ -0,0 +1,5 @@ +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_26247.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_26247.result new file mode 100644 index 00000000000..63fe775a6fe --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_26247.result @@ -0,0 +1,55 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +MDEV-26247 Spider: Valid LEFT JOIN results in ERROR 1064 + +connection child2_1; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +CREATE TABLE tbl_a ( +a int, +primary key (a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE tbl_b ( +c int, +d int, +primary key (c, d) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO tbl_a VALUES (1), (2), (3); +INSERT INTO tbl_b VALUES (1, 11), (2, 22), (3, 33); +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +CREATE TABLE tbl_a ( +a int, +primary key (a) +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='srv "s_2_1", table "tbl_a"'; +CREATE TABLE tbl_b ( +c int, +d int, +primary key (c, d) +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='srv "s_2_1", table "tbl_b"'; +SELECT d FROM tbl_a LEFT JOIN tbl_b ON a = c WHERE a IN (1); +d +11 +SELECT d FROM tbl_b RIGHT JOIN tbl_a ON c = a WHERE a IN (2); +d +22 +SELECT d FROM tbl_b RIGHT JOIN tbl_a ON c = a WHERE a IN (1,2); +d +11 +22 +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26247.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_26247.cnf new file mode 100644 index 00000000000..05dfd8a0bce --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26247.cnf @@ -0,0 +1,3 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf +!include ../my_2_1.cnf diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26247.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_26247.test new file mode 100644 index 00000000000..eff7b3db2e4 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26247.test @@ -0,0 +1,48 @@ +--source ../include/mdev_26247_init.inc +--echo +--echo MDEV-26247 Spider: Valid LEFT JOIN results in ERROR 1064 +--echo + +--connection child2_1 +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +eval CREATE TABLE tbl_a ( + a int, + primary key (a) +) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; + +eval CREATE TABLE tbl_b ( + c int, + d int, + primary key (c, d) +) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; + +INSERT INTO tbl_a VALUES (1), (2), (3); +INSERT INTO tbl_b VALUES (1, 11), (2, 22), (3, 33); + +--connection master_1 +CREATE DATABASE auto_test_local; +USE auto_test_local; + +eval CREATE TABLE tbl_a ( + a int, + primary key (a) +) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='srv "s_2_1", table "tbl_a"'; + +eval CREATE TABLE tbl_b ( + c int, + d int, + primary key (c, d) +) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='srv "s_2_1", table "tbl_b"'; + +SELECT d FROM tbl_a LEFT JOIN tbl_b ON a = c WHERE a IN (1); +SELECT d FROM tbl_b RIGHT JOIN tbl_a ON c = a WHERE a IN (2); +SELECT d FROM tbl_b RIGHT JOIN tbl_a ON c = a WHERE a IN (1,2); + +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +--connection child2_1 +DROP DATABASE IF EXISTS auto_test_remote; + +--source ../include/mdev_26247_deinit.inc |