diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.test index 3174ace8bfb..574a13c8e86 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.test @@ -49,14 +49,18 @@ TRUNCATE TABLE mysql.general_log; --disable_ps2_protocol --connection master_1 +--disable_view_protocol SELECT id, 0 AS const, val FROM tbl_a; SELECT 1+2, id, 0 AS const, val, val+10, (SELECT tbl_a.val+1 FROM tbl_a) AS sq FROM tbl_a; +--enable_view_protocol INSERT INTO tbl_a (val) VALUES (2), (1); +--disable_view_protocol SELECT val+10, 0 AS const, val, (SELECT tbl_a.val+1 FROM tbl_a LIMIT 1) AS sq FROM tbl_a GROUP BY val; SELECT MAX(id) AS m, 0 AS const, val, (SELECT tbl_a.val+1 FROM tbl_a LIMIT 1) AS sq FROM tbl_a GROUP BY val; +--enable_view_protocol --connection child2_1 --disable_view_protocol diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_27172.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_27172.test index 8374713651a..da7a1457a78 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_27172.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_27172.test @@ -50,8 +50,10 @@ eval CREATE TABLE tbl_a ( --disable_ps2_protocol INSERT INTO tbl_a VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!"); +--disable_view_protocol SELECT * FROM tbl_a WHERE greeting = "Aloha!" AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one"; # hack to disable GBH +--enable_view_protocol # LIKE eval CREATE TABLE tbl_b ( @@ -61,8 +63,10 @@ eval CREATE TABLE tbl_b ( ) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_b", srv "s_2_1"'; INSERT INTO tbl_b VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!"); +--disable_view_protocol SELECT * FROM tbl_b WHERE greeting = "Aloha!" AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one"; # hack to disable GBH +--enable_view_protocol # LIKE eval CREATE TABLE tbl_c ( @@ -72,8 +76,10 @@ eval CREATE TABLE tbl_c ( ) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_c", srv "s_2_1"'; INSERT INTO tbl_c VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!"); +--disable_view_protocol SELECT * FROM tbl_c WHERE greeting = "Aloha!" AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one"; # hack to disable GBH +--enable_view_protocol --connection child2_1 --disable_view_protocol diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_34659.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_34659.test index 3b1dc206866..330b96db6f9 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_34659.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_34659.test @@ -12,7 +12,10 @@ CREATE TABLE t1 (c INT) ENGINE=MyISAM; CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",SRV "srv",TABLE "t1"'; insert into t2 values (456), (123); SELECT * FROM t2 ORDER BY CAST(c AS char(60)); +# extra warnings with view protocol +--disable_view_protocol SELECT * FROM t2 ORDER BY CAST(c AS INET6); +--enable_view_protocol SELECT * FROM t2 GROUP BY CAST(c AS char(60)); SELECT * FROM t2 GROUP BY CAST(c AS INET6); # Cleanup diff --git a/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test b/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test index ae7e6643e3b..72502b64f78 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test +++ b/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test @@ -47,12 +47,12 @@ TRUNCATE TABLE mysql.general_log; --disable_ps2_protocol --connection master_1 +--disable_view_protocol SELECT * FROM tbl_a ORDER BY pkey; +--enable_view_protocol --connection child2_1 --disable_view_protocol -# in --ps a query is logged differently in a general log -replace_regex /order by t0.`pkey`/order by `pkey`/; eval $CHILD2_1_SELECT_ARGUMENT1; --enable_view_protocol eval $CHILD2_1_SELECT_TABLES; diff --git a/storage/spider/mysql-test/spider/t/auto_increment.test b/storage/spider/mysql-test/spider/t/auto_increment.test index 5e3fff3dc55..b4f0610fa58 100644 --- a/storage/spider/mysql-test/spider/t/auto_increment.test +++ b/storage/spider/mysql-test/spider/t/auto_increment.test @@ -145,7 +145,9 @@ if ($USE_CHILD_GROUP2) } --connection master_1 --disable_ps2_protocol +--disable_view_protocol SELECT * FROM tbl_a; +--enable_view_protocol if ($USE_CHILD_GROUP2) { if (!$OUTPUT_CHILD_GROUP2) diff --git a/storage/spider/mysql-test/spider/t/direct_join_using.test b/storage/spider/mysql-test/spider/t/direct_join_using.test index 61942b1998e..44d563b27ca 100644 --- a/storage/spider/mysql-test/spider/t/direct_join_using.test +++ b/storage/spider/mysql-test/spider/t/direct_join_using.test @@ -156,7 +156,9 @@ if ($USE_CHILD_GROUP2) --connection master_1 --disable_ps2_protocol +--disable_view_protocol SELECT a.a, c.b, c.c FROM tbl_a a join tbl_b b using(a) join tbl_c c using(a) ORDER BY a.b DESC; +--enable_view_protocol if ($USE_CHILD_GROUP2) { diff --git a/storage/spider/mysql-test/spider/t/direct_left_join.test b/storage/spider/mysql-test/spider/t/direct_left_join.test index 31744aa199d..ed36f580a52 100644 --- a/storage/spider/mysql-test/spider/t/direct_left_join.test +++ b/storage/spider/mysql-test/spider/t/direct_left_join.test @@ -156,7 +156,9 @@ if ($USE_CHILD_GROUP2) --connection master_1 --disable_ps2_protocol +--disable_view_protocol SELECT a.a, c.b, c.c FROM tbl_a a left join tbl_b b on a.a = b.a left join tbl_c c on a.a = c.a ORDER BY a.b DESC; +--enable_view_protocol if ($USE_CHILD_GROUP2) { diff --git a/storage/spider/mysql-test/spider/t/direct_right_join.test b/storage/spider/mysql-test/spider/t/direct_right_join.test index 823d5176f34..effa1121c8b 100644 --- a/storage/spider/mysql-test/spider/t/direct_right_join.test +++ b/storage/spider/mysql-test/spider/t/direct_right_join.test @@ -156,7 +156,9 @@ if ($USE_CHILD_GROUP2) --connection master_1 --disable_ps2_protocol +--disable_view_protocol SELECT a.a, c.b, c.c FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on a.a = c.a ORDER BY a.b DESC; +--enable_view_protocol if ($USE_CHILD_GROUP2) { diff --git a/storage/spider/mysql-test/spider/t/pushdown_not_like.test b/storage/spider/mysql-test/spider/t/pushdown_not_like.test index 5e7de1ff0ed..cf2ed838d31 100644 --- a/storage/spider/mysql-test/spider/t/pushdown_not_like.test +++ b/storage/spider/mysql-test/spider/t/pushdown_not_like.test @@ -105,7 +105,9 @@ if ($USE_CHILD_GROUP2) --connection master_1 --disable_ps2_protocol +--disable_view_protocol select * from ta_l where b not like 'a%'; +--enable_view_protocol if ($USE_CHILD_GROUP2) { --connection child2_1 diff --git a/storage/spider/mysql-test/spider/t/timestamp.test b/storage/spider/mysql-test/spider/t/timestamp.test index fddfbfd3880..20fa69a6287 100644 --- a/storage/spider/mysql-test/spider/t/timestamp.test +++ b/storage/spider/mysql-test/spider/t/timestamp.test @@ -172,7 +172,9 @@ if ($USE_CHILD_GROUP2) } --connection master_1 --disable_ps2_protocol +--disable_view_protocol SELECT *, unix_timestamp(col_ts) FROM tbl_a; +--enable_view_protocol if ($USE_CHILD_GROUP2) { if (!$OUTPUT_CHILD_GROUP2) @@ -218,9 +220,10 @@ if ($USE_CHILD_GROUP2) } --connection master_1 DELETE FROM tbl_a WHERE col_ts='1970-01-01 01:00:01'; ---disable_view_protocol --disable_ps2_protocol +--disable_view_protocol SELECT *, unix_timestamp(col_ts) FROM tbl_a; +--enable_view_protocol if ($USE_CHILD_GROUP2) { if (!$OUTPUT_CHILD_GROUP2) @@ -266,7 +269,9 @@ SET @@timestamp=1; INSERT INTO tbl_a VALUES (1, now(), now()); SET @@timestamp=0; --disable_ps2_protocol +--disable_view_protocol SELECT *, unix_timestamp(col_ts) FROM tbl_a; +--enable_view_protocol if ($USE_CHILD_GROUP2) { if (!$OUTPUT_CHILD_GROUP2) @@ -313,7 +318,9 @@ if ($USE_CHILD_GROUP2) --connection master_1 UPDATE tbl_a SET col_ts=col_dt; --disable_ps2_protocol +--disable_view_protocol SELECT *, unix_timestamp(col_ts) FROM tbl_a; +--enable_view_protocol if ($USE_CHILD_GROUP2) { if (!$OUTPUT_CHILD_GROUP2) @@ -359,6 +366,7 @@ if ($USE_CHILD_GROUP2) } --connection master_1 --disable_ps2_protocol +--disable_view_protocol SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > '2018-01-01'; SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts < '2018-10-28 02:30:00'; SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE '2018-10-28 02:30:00' > col_ts; @@ -366,6 +374,7 @@ SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts BETWEEN '2018-10-28 01: SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts >= '2018-10-28 01:30:00' AND col_ts <= '2018-10-28 02:30:00'; SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > 180325020000; SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > 19700101010001; +--enable_view_protocol if ($USE_CHILD_GROUP2) { if (!$OUTPUT_CHILD_GROUP2) @@ -441,6 +450,7 @@ if ($USE_CHILD_GROUP2) } --connection master_1 --disable_ps2_protocol +--disable_view_protocol SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > '2018-01-01'; SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts < '2018-10-28 02:30:00'; SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE '2018-10-28 02:30:00' > col_ts; @@ -448,6 +458,7 @@ SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts BETWEEN '2018-10-28 01: SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts >= '2018-10-28 01:30:00' AND col_ts <= '2018-10-28 02:30:00'; SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > 180325020000; SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > 19700101010001; +--enable_view_protocol if ($USE_CHILD_GROUP2) { if (!$OUTPUT_CHILD_GROUP2) @@ -497,11 +508,13 @@ if ($USE_CHILD_GROUP2) } --connection master_1 --disable_ps2_protocol +--disable_view_protocol SELECT * FROM tbl_f; SELECT TIMESTAMP(col_d, col_t) FROM tbl_f; SELECT TIMESTAMP('2018-06-25', col_t) FROM tbl_f; SELECT TIMESTAMP(col_d, '10:43:21') FROM tbl_f; SELECT TIMESTAMP('2018-06-25', '10:43:21') FROM tbl_f; +--enable_view_protocol if ($USE_CHILD_GROUP2) { if (!$OUTPUT_CHILD_GROUP2) diff --git a/storage/spider/mysql-test/spider/t/udf_pushdown.inc b/storage/spider/mysql-test/spider/t/udf_pushdown.inc index 93e570a656d..16f85dfffcd 100644 --- a/storage/spider/mysql-test/spider/t/udf_pushdown.inc +++ b/storage/spider/mysql-test/spider/t/udf_pushdown.inc @@ -2,8 +2,10 @@ --echo ##### test SELECTs ##### --connection master_1 --disable_ps2_protocol +--disable_view_protocol SELECT * FROM ta_l WHERE id = plusone(1); SELECT * FROM ta_l WHERE id IN (plusone(1), plusone(2)) AND a = plusone(32); +--enable_view_protocol --enable_ps2_protocol if ($USE_CHILD_GROUP2)