From a9962580ab1b5edcba8152c69d33b937c91a3d80 Mon Sep 17 00:00:00 2001 From: Lena Startseva Date: Tue, 27 Sep 2022 10:55:22 +0700 Subject: [PATCH] MDEV-27691: make working view-protocol Update tests for version 10.6 --- mysql-test/main/binary.test | 3 +++ mysql-test/main/fetch_first.test | 11 +++++++++-- mysql-test/main/flush.test | 4 +++- mysql-test/main/fulltext.test | 2 ++ mysql-test/main/func_str.test | 6 ++++++ mysql-test/main/func_test.test | 3 +++ mysql-test/main/func_weight_string.test | 5 +++++ mysql-test/main/locking_clause.test | 2 ++ mysql-test/main/long_host.test | 2 ++ mysql-test/main/olap.test | 3 +++ mysql-test/main/opt_trace.test | 6 ++++++ mysql-test/main/plugin_auth.test | 3 +++ mysql-test/main/ps_missed_cmds.test | 6 ++++-- mysql-test/main/range.test | 3 +++ mysql-test/main/rownum.test | 5 +++++ mysql-test/main/select.test | 3 +++ mysql-test/main/stat_tables_par.inc | 4 ++++ 17 files changed, 66 insertions(+), 5 deletions(-) diff --git a/mysql-test/main/binary.test b/mysql-test/main/binary.test index 1cc6ae07675b8..ebb3d7ba3c842 100644 --- a/mysql-test/main/binary.test +++ b/mysql-test/main/binary.test @@ -18,9 +18,12 @@ select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) f select * from t2 order by name; select concat("*",name,"*") from t2 order by 1; select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) from t2; +#check after fix MDEV-29601 +--disable_service_connection select name from t1 where name between 'Ä' and 'Ö'; select name from t2 where name between 'ä' and 'ö'; select name from t2 where name between 'Ä' and 'Ö'; +--enable_service_connection drop table t1,t2; diff --git a/mysql-test/main/fetch_first.test b/mysql-test/main/fetch_first.test index 7c41b922978f9..62cdd717f816c 100644 --- a/mysql-test/main/fetch_first.test +++ b/mysql-test/main/fetch_first.test @@ -16,6 +16,8 @@ insert into t_keyword values (1), (1), (2), (3), (2); --echo # Make sure the FETCH clause addition didn't introduce problems with --echo # the offset keyword. --echo # +#enable after fix MDEV-29645 +--disable_view_protocol select * from t1 order by a offset 2 rows; @@ -24,7 +26,7 @@ offset 2 rows; --sorted_result select * from t1 offset 2 rows; - +--enable_view_protocol --echo # --echo # Offset is now a reserved keyword. Column names can not have that name @@ -682,7 +684,8 @@ order by first_name offset 1 rows fetch first 2 rows with ties; - +#enable after fix MDEV-29645 +--disable_view_protocol select first_name, row_number() over () rn from t1 order by rn @@ -694,6 +697,7 @@ from t1 order by rn desc offset 1 rows fetch first 2 rows with ties; +--enable_view_protocol select first_name, score, rank() over (ORDER BY score) from t1 @@ -811,6 +815,8 @@ drop table t2; create table t1 (a int, b int, index (a,b)); insert into t1 values (1,1), (1,2), (1,3), (2,1), (2,2), (3,1); +#enable after fix MDEV-29645 +--disable_view_protocol select SQL_CALC_FOUND_ROWS a, b, count(*) from t1 group by a, b @@ -824,6 +830,7 @@ from t1 order by a fetch first 1 rows with ties; SELECT FOUND_ROWS(); +--enable_view_protocol --echo # --echo # Test index read optimization with ORDER BY as sub part of GROUP BY diff --git a/mysql-test/main/flush.test b/mysql-test/main/flush.test index 841c7f182b6da..887c48ef018e0 100644 --- a/mysql-test/main/flush.test +++ b/mysql-test/main/flush.test @@ -672,7 +672,7 @@ UNLOCK TABLES; DROP VIEW v1; DROP TABLE t1; ---enable_service_connection + --echo # --echo # MDEV-15888 Implement FLUSH TABLES tbl_name [, tbl_name] ... WITH READ LOCK for views. --echo # @@ -787,3 +787,5 @@ DROP VIEW v2, v1, v0; --echo # --echo # End of 10.6 tests --echo # + +--enable_service_connection diff --git a/mysql-test/main/fulltext.test b/mysql-test/main/fulltext.test index 487c2f151b007..8b90c9cd81d7d 100644 --- a/mysql-test/main/fulltext.test +++ b/mysql-test/main/fulltext.test @@ -347,7 +347,9 @@ drop table t1, t2; CREATE TABLE t1 (t VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci, FULLTEXT (t)); SET NAMES latin1; INSERT INTO t1 VALUES('Mit freundlichem Grüß aus Osnabrück'); +--disable_service_connection SELECT COUNT(*) FROM t1 WHERE MATCH(t) AGAINST ('"osnabrück"' IN BOOLEAN MODE); +--enable_service_connection DROP TABLE t1; # diff --git a/mysql-test/main/func_str.test b/mysql-test/main/func_str.test index b8bb8a54090d6..390b5199cec05 100644 --- a/mysql-test/main/func_str.test +++ b/mysql-test/main/func_str.test @@ -53,11 +53,14 @@ select substring_index('aaaaaaaaa1','aaaa',1); select substring_index('aaaaaaaaa1','aaaa',2); select substring_index('aaaaaaaaa1','1',1); select substring_index('aaaaaaaaa1','a',-1); +#enable after fix MDEV-29601 +--disable_service_connection select substring_index('aaaaaaaaa1','aa',-1); select substring_index('aaaaaaaaa1','aa',-2); select substring_index('aaaaaaaaa1','aa',-3); select substring_index('aaaaaaaaa1','aa',-4); select substring_index('aaaaaaaaa1','aa',-5); +--enable_service_connection select substring_index('aaaaaaaaa1','aaa',-1); select substring_index('aaaaaaaaa1','aaa',-2); select substring_index('aaaaaaaaa1','aaa',-3); @@ -321,10 +324,13 @@ select FIELD('b','A','B'); select FIELD('B','A','B'); select FIELD('b' COLLATE latin1_bin,'A','B'); select FIELD('b','A' COLLATE latin1_bin,'B'); +#enable after fix MDEV-29601 +--disable_service_connection --error 1270 select FIELD(_latin2'b','A','B'); --error 1270 select FIELD('b',_latin2'A','B'); +--enable_service_connection select FIELD('1',_latin2'3','2',1); select POSITION(_latin1'B' IN _latin1'abcd'); diff --git a/mysql-test/main/func_test.test b/mysql-test/main/func_test.test index 02b08d13dbed6..c8206d34a12c1 100644 --- a/mysql-test/main/func_test.test +++ b/mysql-test/main/func_test.test @@ -14,7 +14,10 @@ select "abc" like "a%", "abc" not like "%d%", "a%" like "a\%","abc%" like "a%\%" select "a" like "%%b","a" like "%%ab","ab" like "a\%", "ab" like "_", "ab" like "ab_", "abc" like "%_d", "abc" like "abc%d"; select '?' like '|%', '?' like '|%' ESCAPE '|', '%' like '|%', '%' like '|%' ESCAPE '|', '%' like '%'; select 'abc' like '%c','abcabc' like '%c', "ab" like "", "ab" like "a", "ab" like "ab"; +#enable after fix MDEV-29601 +--disable_service_connection select "Det här är svenska" regexp "h[[:alpha:]]+r", "aba" regexp "^(a|b)*$"; +--enable_service_connection select "aba" regexp concat("^","a"); select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0; select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between "max" and "my" and 3=3; diff --git a/mysql-test/main/func_weight_string.test b/mysql-test/main/func_weight_string.test index 528aa5d4f0fb9..e2043e8657fd9 100644 --- a/mysql-test/main/func_weight_string.test +++ b/mysql-test/main/func_weight_string.test @@ -2,6 +2,9 @@ drop table if exists t1; --enable_warnings +#check after fix MDEV-29601 +--disable_service_connection + set @save_max_allowed_packet=@@max_allowed_packet; set global max_allowed_packet=1048576; connect (conn1,localhost,root,,); @@ -120,6 +123,8 @@ disconnect conn1; connection default; set global max_allowed_packet=@save_max_allowed_packet; +--enable_service_connection + --echo # --echo # Start of 10.1 tests --echo # diff --git a/mysql-test/main/locking_clause.test b/mysql-test/main/locking_clause.test index acba190b29f09..ccf51103e492e 100644 --- a/mysql-test/main/locking_clause.test +++ b/mysql-test/main/locking_clause.test @@ -115,6 +115,7 @@ DROP TABLE t1, t2; --echo # --echo # Bug#25972285: UNCLEAR ERROR MESSAGE FOR NOWAIT --echo # +--disable_view_protocol CREATE USER test@localhost; GRANT CREATE, SELECT, UPDATE on *.* to test@localhost; @@ -144,6 +145,7 @@ disconnect con2; DROP TABLE t1; DROP USER test@localhost; DROP USER test2@localhost; +--enable_view_protocol --echo # --echo # Bug#30237291: "SELECT ... INTO VAR_NAME FOR UPDATE" NOT WORKING IN diff --git a/mysql-test/main/long_host.test b/mysql-test/main/long_host.test index f176279749af6..0c082bf6fb41b 100644 --- a/mysql-test/main/long_host.test +++ b/mysql-test/main/long_host.test @@ -1,6 +1,8 @@ --source include/have_debug_sync.inc --source include/not_embedded.inc +#enable view protocol after fix MDEV-29542 +--source include/no_view_protocol.inc --echo # check user diff --git a/mysql-test/main/olap.test b/mysql-test/main/olap.test index 0c990300b68ec..c88d3e1202e7c 100644 --- a/mysql-test/main/olap.test +++ b/mysql-test/main/olap.test @@ -55,7 +55,10 @@ select product, country_id , year, sum(profit) from t1 group by product, country select concat(product,':',country_id) as 'prod', concat(":",year,":") as 'year',1+1, sum(profit)/count(*) from t1 group by 1,2 with rollup; select product, sum(profit)/count(*) from t1 group by product with rollup; select left(product,4) as prod, sum(profit)/count(*) from t1 group by prod with rollup; +#check after fix MDEV-29601 +--disable_service_connection select concat(product,':',country_id), 1+1, sum(profit)/count(*) from t1 group by concat(product,':',country_id) with rollup; +--enable_service_connection # Joins select product, country , year, sum(profit) from t1,t2 where t1.country_id=t2.country_id group by product, country, year with rollup; diff --git a/mysql-test/main/opt_trace.test b/mysql-test/main/opt_trace.test index 343c36e0f293e..e98964c283069 100644 --- a/mysql-test/main/opt_trace.test +++ b/mysql-test/main/opt_trace.test @@ -831,10 +831,12 @@ from t1 left join (t2,t3) on t2.a=t1.a and t3.a=t2.a and t3.a + t2.a <1000 where t1.b > 5555; +--disable_view_protocol select json_detailed(json_extract(trace, '$**.substitute_best_equal')) from information_schema.optimizer_trace; +--enable_view_protocol --echo # The next query is test for: --echo # MDEV-23646: Optimizer trace: optimize_cond() should show ON expression processing @@ -881,10 +883,12 @@ where t1.b < 3; # Just show that choose_best_splitting function has coverage in the # optimizer trace and re-optmization of child select inside it is distinct # from the rest of join optimization. +--disable_view_protocol select json_detailed(json_extract(trace, '$**.choose_best_splitting')) from information_schema.optimizer_trace; +--enable_view_protocol # Same as above. just to show that splitting plan has some coverage in the # trace. @@ -903,9 +907,11 @@ CREATE TABLE t1(id INT, f1 JSON); INSERT INTO t1 VALUES (1, '{\"1\": 1}'), (2, '{\"1\": 2}'), (3, '{\"1\": 3}'), (4, '{\"1\": 4}'), (5, '{\"1\": 5}'), (6, '{\"1\": 6}'); +--disable_view_protocol SELECT * FROM t1 WHERE id IN (SELECT id FROM t1 as tt2, JSON_TABLE(f1, "$" COLUMNS (jf FOR ORDINALITY)) AS tbl); +--enable_view_protocol select json_detailed(json_extract(trace, '$**.best_join_order')) from information_schema.OPTIMIZER_TRACE; diff --git a/mysql-test/main/plugin_auth.test b/mysql-test/main/plugin_auth.test index 30e4fa6e0ad2c..8b10f0883768d 100644 --- a/mysql-test/main/plugin_auth.test +++ b/mysql-test/main/plugin_auth.test @@ -3,6 +3,9 @@ --source include/mysql_upgrade_preparation.inc --source include/have_innodb.inc +#enable view protocol after fix MDEV-29542 +--source include/no_view_protocol.inc + SET GLOBAL SQL_MODE=""; SET LOCAL SQL_MODE=""; diff --git a/mysql-test/main/ps_missed_cmds.test b/mysql-test/main/ps_missed_cmds.test index 2bce4bef17e23..8b80a7c7e5dc8 100644 --- a/mysql-test/main/ps_missed_cmds.test +++ b/mysql-test/main/ps_missed_cmds.test @@ -72,7 +72,7 @@ DROP TABLE t1; --echo # Test case 3: Check that the 'USE' statement is supported by --echo # prepared statements - +--disable_service_connection CREATE DATABASE mdev_16708_db; PREPARE stmt_1 FROM 'USE mdev_16708_db'; EXECUTE stmt_1; @@ -88,7 +88,7 @@ SELECT DATABASE(); DEALLOCATE PREPARE stmt_1; USE test; DROP DATABASE mdev_16708_db; - +--enable_service_connection --echo # Test case 4: Check that the 'ALTER DATABASE' statement is supported --echo # by prepared statements CREATE DATABASE mdev_16708_db; @@ -151,6 +151,7 @@ DROP TABLE t1; --echo # Test case 7: Check that the BEGIN/SAVEPOINT/RELEASE SAVEPOINT --echo # statements are supported by prepared statements +--disable_view_protocol --echo # Set up environmentr for the test case CREATE TABLE t1 (a INT); @@ -195,6 +196,7 @@ DEALLOCATE PREPARE stmt_1; DEALLOCATE PREPARE stmt_2; DEALLOCATE PREPARE stmt_3; DROP TABLE t1; +--enable_view_protocol --echo # Test case 8: Check that the 'PURGE BINARY LOGS BEFORE' statement --echo # is supported by prepared statements diff --git a/mysql-test/main/range.test b/mysql-test/main/range.test index 54cd5bfa1903d..69db5fb22ddd7 100644 --- a/mysql-test/main/range.test +++ b/mysql-test/main/range.test @@ -1671,6 +1671,8 @@ INSERT INTO t1 (fd) SELECT fd FROM t1; INSERT INTO t1 (fd) SELECT fd FROM t1; INSERT INTO t1 (fd) SELECT fd FROM t1; INSERT INTO t1 (fd) SELECT fd FROM t1; +#check after fix MDEV-29601 +--disable_service_connection --echo # The following should show "Impossible WHERE" : explain SELECT * FROM t1 WHERE fd='ðŸ˜'; @@ -1681,6 +1683,7 @@ SELECT * FROM t1 WHERE fd='ðŸ˜'; explain select count(*) from t1 where fd <'ðŸ˜'; select count(*) from t1 where fd <'ðŸ˜'; select count(*) from t1 ignore index (ix_fd) where fd <'ðŸ˜'; +--enable_service_connection drop table t1; set names default; diff --git a/mysql-test/main/rownum.test b/mysql-test/main/rownum.test index 3fe1ac13aac72..bdd0bfa4f41d1 100644 --- a/mysql-test/main/rownum.test +++ b/mysql-test/main/rownum.test @@ -97,7 +97,10 @@ CREATE TABLE t3 ( b varchar(1024) DEFAULT NULL ); insert into t3 select mod(seq*3,20)+1, repeat(char(33+mod(seq,90)),mod(seq,10)*100) from seq_1_to_23; +#chack after fix MDEV-28571 +--disable_view_protocol SELECT sq.a,length(sq.f) FROM (SELECT a, GROUP_CONCAT(b,b) AS f FROM t3 GROUP BY a ORDER BY a desc) as sq WHERE ROWNUM() <= 10; +--enable_view_protocol drop table t3; --echo # @@ -433,6 +436,7 @@ drop table t1; create table t1 (a int); insert into t1 values (1),(2),(3),(4),(5); +--disable_view_protocol let $query= select * from (select a from t1 where a < 1000) as tt where rownum() <= 2; flush status; @@ -481,6 +485,7 @@ eval prepare stmt from "$query"; execute stmt; execute stmt; deallocate prepare stmt; +--enable_view_protocol --echo # Other limit diff --git a/mysql-test/main/select.test b/mysql-test/main/select.test index 7a2b083bdf0fb..5b261214fa3c5 100644 --- a/mysql-test/main/select.test +++ b/mysql-test/main/select.test @@ -2611,7 +2611,10 @@ SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; # this should work when sql_mode is not NO_BACKSLASH_ESCAPES SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +#enable after fix MDEV-29601 +--disable_service_connection SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE ''; +--enable_service_connection SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%'; SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE '\\'; diff --git a/mysql-test/main/stat_tables_par.inc b/mysql-test/main/stat_tables_par.inc index 16f64cebfe767..52e66ef09d218 100644 --- a/mysql-test/main/stat_tables_par.inc +++ b/mysql-test/main/stat_tables_par.inc @@ -1,6 +1,8 @@ # Note that this test requires a fresh restart to not have problems with the # old status values +--disable_service_connection + set @save_use_stat_tables=@@use_stat_tables; set use_stat_tables='preferably'; @@ -241,6 +243,8 @@ DROP DATABASE dbt3_s001; use test; +--enable_service_connection + # # Bug mdev-4019: crash when executing in parallel ANALYZE and # SELECT * FROM information_schema.statistics