diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2020-11-01 14:26:15 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2020-11-01 14:26:15 +0100 |
commit | 8e1e2856f2523c225a81840059e93fa9f61fbacf (patch) | |
tree | f1c708faf5aaeb27f255531d8c0f9dac32833b5b /mysql-test/main | |
parent | b0ff791618d97487fb7515d3f785b37f46eba132 (diff) | |
parent | 80c951ce2875aac521b82323b5b6ebf638593445 (diff) | |
download | mariadb-git-8e1e2856f2523c225a81840059e93fa9f61fbacf.tar.gz |
Merge branch '10.4' into 10.5
Diffstat (limited to 'mysql-test/main')
22 files changed, 463 insertions, 27 deletions
diff --git a/mysql-test/main/blackhole.result b/mysql-test/main/blackhole.result index 36f5459ff85..a7281c42ca7 100644 --- a/mysql-test/main/blackhole.result +++ b/mysql-test/main/blackhole.result @@ -24,3 +24,9 @@ SELECT 0 FROM t1 FORCE INDEX FOR GROUP BY(a) WHERE a = 0 OR b = 0 AND c = 0; 0 DROP TABLE t1; End of 5.6 tests +CREATE TABLE `t` ( +`a` varchar(3000) NOT NULL default '', +PRIMARY KEY (`a`) +) ENGINE=BLACKHOLE; +DROP TABLE `t`; +End of 10.1 tests diff --git a/mysql-test/main/blackhole.test b/mysql-test/main/blackhole.test index 7f394e0f846..c80ceffef4c 100644 --- a/mysql-test/main/blackhole.test +++ b/mysql-test/main/blackhole.test @@ -38,3 +38,19 @@ SELECT 0 FROM t1 FORCE INDEX FOR GROUP BY(a) WHERE a = 0 OR b = 0 AND c = 0; DROP TABLE t1; --echo End of 5.6 tests + +# +# MDEV-24017 / bug 53588 test case. +# +# Create long enough index (between 1000 and 3500). 1000 is the old value, +# 3500 is innodb value (see ha_innobase::max_supported_key_length()). Without +# the fix the test will fail with "Specified key was too long" error. +# +CREATE TABLE `t` ( + `a` varchar(3000) NOT NULL default '', + PRIMARY KEY (`a`) +) ENGINE=BLACKHOLE; + +DROP TABLE `t`; + +--echo End of 10.1 tests diff --git a/mysql-test/main/bootstrap_innodb.result b/mysql-test/main/bootstrap_innodb.result new file mode 100644 index 00000000000..2807a9776a5 --- /dev/null +++ b/mysql-test/main/bootstrap_innodb.result @@ -0,0 +1,8 @@ +create table t1(a int) engine=innodb; +# restart +select * from t1; +a +1 +2 +5 +drop table t1; diff --git a/mysql-test/main/bootstrap_innodb.test b/mysql-test/main/bootstrap_innodb.test new file mode 100644 index 00000000000..ddaefb32155 --- /dev/null +++ b/mysql-test/main/bootstrap_innodb.test @@ -0,0 +1,27 @@ +source include/have_static_innodb.inc; +source include/not_embedded.inc; + +let $datadir= `select @@datadir`; + +create table t1(a int) engine=innodb; +source include/shutdown_mysqld.inc; + +write_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql; +use test; +insert t1 values (1); +start transaction; +insert t1 values (2); +savepoint s1; +insert t1 values (3); +savepoint s2; +insert t1 values (4); +rollback to savepoint s1; +insert t1 values (5); +commit; +EOF +exec $MYSQLD_BOOTSTRAP_CMD --datadir=$datadir --innodb < $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1; +remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql; + +source include/start_mysqld.inc; +select * from t1; +drop table t1; diff --git a/mysql-test/main/func_group.result b/mysql-test/main/func_group.result index 9233393fd94..1fc92ba90cc 100644 --- a/mysql-test/main/func_group.result +++ b/mysql-test/main/func_group.result @@ -1186,13 +1186,13 @@ i count(*) std(e1/e2) 3 4 0.00000000 select std(s1/s2) from bug22555; std(s1/s2) -0.21328517 +0.21325764 select std(o1/o2) from bug22555; std(o1/o2) 0.2132576358664934 select std(e1/e2) from bug22555; std(e1/e2) -0.21328517 +0.21325764 set @saved_div_precision_increment=@@div_precision_increment; set div_precision_increment=19; select i, count(*), std(s1/s2) from bug22555 group by i order by i; diff --git a/mysql-test/main/kill.result b/mysql-test/main/kill.result index 55839817fd4..1ea06aee096 100644 --- a/mysql-test/main/kill.result +++ b/mysql-test/main/kill.result @@ -375,8 +375,7 @@ SELECT SLEEP(1000); connection con1; KILL QUERY ID @id; connection default; -SLEEP(1000) -1 +ERROR 70100: Query execution was interrupted KILL QUERY ID 0; ERROR HY000: Unknown query id: 0 # @@ -392,8 +391,7 @@ ERROR HY000: You are not owner of query ID connection con1; KILL QUERY ID @id; connection default; -SLEEP(1000) -1 +ERROR 70100: Query execution was interrupted disconnect con5; DROP USER u1@localhost; SET DEBUG_SYNC = 'RESET'; diff --git a/mysql-test/main/kill.test b/mysql-test/main/kill.test index 728b6b964e2..a3962e9dc49 100644 --- a/mysql-test/main/kill.test +++ b/mysql-test/main/kill.test @@ -606,6 +606,7 @@ let $wait_condition= SELECT @id:=QUERY_ID FROM INFORMATION_SCHEMA.PROCESSLIST WH source include/wait_condition.inc; KILL QUERY ID @id; connection default; +--error ER_QUERY_INTERRUPTED reap; --error ER_NO_SUCH_QUERY @@ -632,6 +633,7 @@ connection con1; KILL QUERY ID @id; connection default; +--error ER_QUERY_INTERRUPTED reap; disconnect con5; DROP USER u1@localhost; diff --git a/mysql-test/main/lock_view.result b/mysql-test/main/lock_view.result new file mode 100644 index 00000000000..4d375bace42 --- /dev/null +++ b/mysql-test/main/lock_view.result @@ -0,0 +1,231 @@ +create database mysqltest1; +create database mysqltest2; +create database mysqltest3; +create user invoker@localhost; +create user definer@localhost; +grant select,show view on mysqltest1.* to invoker@localhost; +grant select,show view on mysqltest1.* to definer@localhost; +grant select,show view on mysqltest2.* to invoker@localhost; +grant select,show view on mysqltest2.* to definer@localhost; +grant select,show view on mysqltest3.* to invoker@localhost; +grant select on performance_schema.* to definer@localhost; +create table mysqltest1.t1 (a int); +create definer=definer@localhost view mysqltest2.v2 as select * from mysqltest1.t1; +create definer=definer@localhost view mysqltest3.v3 as select * from mysqltest2.v2; +create definer=definer@localhost view mysqltest3.v3is as select schema_name from information_schema.schemata order by schema_name; +create definer=definer@localhost view mysqltest3.v3ps as select user from performance_schema.users where current_connections>0 order by user; +create definer=definer@localhost view mysqltest3.v3nt as select 1; +create definer=definer@localhost sql security invoker view mysqltest3.v3i as select * from mysqltest1.t1; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `mysqltest1`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `mysqltest2`; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v2` ( + `a` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `mysqltest3`; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v3` ( + `a` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v3i` ( + `a` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v3is` ( + `schema_name` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v3nt` ( + `1` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v3ps` ( + `user` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; + +USE `mysqltest1`; + +USE `mysqltest2`; +/*!50001 DROP TABLE IF EXISTS `v2`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`definer`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v2` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; + +USE `mysqltest3`; +/*!50001 DROP TABLE IF EXISTS `v3`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`definer`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v3` AS select `v2`.`a` AS `a` from `mysqltest2`.`v2` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v3i`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`definer`@`localhost` SQL SECURITY INVOKER */ +/*!50001 VIEW `v3i` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v3is`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`definer`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v3is` AS select `information_schema`.`schemata`.`SCHEMA_NAME` AS `schema_name` from `information_schema`.`schemata` order by `information_schema`.`schemata`.`SCHEMA_NAME` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v3nt`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`definer`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v3nt` AS select 1 AS `1` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v3ps`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`definer`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v3ps` AS select `performance_schema`.`users`.`USER` AS `user` from `performance_schema`.`users` where `performance_schema`.`users`.`CURRENT_CONNECTIONS` > 0 order by `performance_schema`.`users`.`USER` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +connect inv,localhost,invoker; +lock table mysqltest3.v3 write; +ERROR 42000: Access denied for user 'invoker'@'localhost' to database 'mysqltest3' +disconnect inv; +connection default; +grant lock tables on mysqltest3.* to invoker@localhost; +connect inv,localhost,invoker; +show create view mysqltest3.v3; +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`definer`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest3`.`v3` AS select `v2`.`a` AS `a` from `mysqltest2`.`v2` latin1 latin1_swedish_ci +show create view mysqltest3.v3is; +View Create View character_set_client collation_connection +v3is CREATE ALGORITHM=UNDEFINED DEFINER=`definer`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest3`.`v3is` AS select `information_schema`.`schemata`.`SCHEMA_NAME` AS `schema_name` from `information_schema`.`schemata` order by `information_schema`.`schemata`.`SCHEMA_NAME` latin1 latin1_swedish_ci +show create view mysqltest3.v3ps; +View Create View character_set_client collation_connection +v3ps CREATE ALGORITHM=UNDEFINED DEFINER=`definer`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest3`.`v3ps` AS select `performance_schema`.`users`.`USER` AS `user` from `performance_schema`.`users` where `performance_schema`.`users`.`CURRENT_CONNECTIONS` > 0 order by `performance_schema`.`users`.`USER` latin1 latin1_swedish_ci +show create view mysqltest3.v3nt; +View Create View character_set_client collation_connection +v3nt CREATE ALGORITHM=UNDEFINED DEFINER=`definer`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest3`.`v3nt` AS select 1 AS `1` latin1 latin1_swedish_ci +show create view mysqltest3.v3i; +View Create View character_set_client collation_connection +v3i CREATE ALGORITHM=UNDEFINED DEFINER=`definer`@`localhost` SQL SECURITY INVOKER VIEW `mysqltest3`.`v3i` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1` latin1 latin1_swedish_ci +lock table mysqltest3.v3 write; +ERROR HY000: View 'mysqltest3.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +lock table mysqltest3.v3i write; +ERROR HY000: View 'mysqltest3.v3i' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +lock table mysqltest3.v3is write; +select * from mysqltest3.v3is; +schema_name +information_schema +mysqltest1 +mysqltest2 +performance_schema +test +lock table mysqltest3.v3ps write; +select * from mysqltest3.v3ps; +user +NULL +invoker +root +lock table mysqltest3.v3nt write; +select * from mysqltest3.v3nt; +1 +1 +disconnect inv; +connection default; +grant lock tables on mysqltest2.* to invoker@localhost; +connect inv,localhost,invoker; +lock table mysqltest3.v3 write; +ERROR HY000: View 'mysqltest3.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +lock table mysqltest3.v3i write; +ERROR HY000: View 'mysqltest3.v3i' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +disconnect inv; +connection default; +grant lock tables on mysqltest1.* to definer@localhost; +connect inv,localhost,invoker; +lock table mysqltest3.v3 write; +select * from mysqltest3.v3; +a +lock table mysqltest3.v3i write; +ERROR HY000: View 'mysqltest3.v3i' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +disconnect inv; +connection default; +grant lock tables on mysqltest1.* to invoker@localhost; +connect inv,localhost,invoker; +lock table mysqltest3.v3i write; +select * from mysqltest3.v3i; +a +disconnect inv; +connection default; +drop user invoker@localhost; +drop user definer@localhost; +drop database mysqltest1; +drop database mysqltest2; +drop database mysqltest3; diff --git a/mysql-test/main/lock_view.test b/mysql-test/main/lock_view.test new file mode 100644 index 00000000000..dd8809ab89d --- /dev/null +++ b/mysql-test/main/lock_view.test @@ -0,0 +1,76 @@ +source include/not_embedded.inc; +# +# LOCK TABLES and privileges on views +# +create database mysqltest1; +create database mysqltest2; +create database mysqltest3; +create user invoker@localhost; +create user definer@localhost; +grant select,show view on mysqltest1.* to invoker@localhost; +grant select,show view on mysqltest1.* to definer@localhost; +grant select,show view on mysqltest2.* to invoker@localhost; +grant select,show view on mysqltest2.* to definer@localhost; +grant select,show view on mysqltest3.* to invoker@localhost; +grant select on performance_schema.* to definer@localhost; +create table mysqltest1.t1 (a int); +create definer=definer@localhost view mysqltest2.v2 as select * from mysqltest1.t1; +create definer=definer@localhost view mysqltest3.v3 as select * from mysqltest2.v2; +create definer=definer@localhost view mysqltest3.v3is as select schema_name from information_schema.schemata order by schema_name; +create definer=definer@localhost view mysqltest3.v3ps as select user from performance_schema.users where current_connections>0 order by user; +create definer=definer@localhost view mysqltest3.v3nt as select 1; +create definer=definer@localhost sql security invoker view mysqltest3.v3i as select * from mysqltest1.t1; + +exec $MYSQL_DUMP --compact -B mysqltest1 mysqltest2 mysqltest3; + +connect inv,localhost,invoker; +error ER_DBACCESS_DENIED_ERROR; +lock table mysqltest3.v3 write; +disconnect inv; +connection default; + +grant lock tables on mysqltest3.* to invoker@localhost; +connect inv,localhost,invoker; +show create view mysqltest3.v3; +show create view mysqltest3.v3is; +show create view mysqltest3.v3ps; +show create view mysqltest3.v3nt; +show create view mysqltest3.v3i; +error ER_VIEW_INVALID; +lock table mysqltest3.v3 write; +error ER_VIEW_INVALID; +lock table mysqltest3.v3i write; +lock table mysqltest3.v3is write; select * from mysqltest3.v3is; +lock table mysqltest3.v3ps write; select * from mysqltest3.v3ps; +lock table mysqltest3.v3nt write; select * from mysqltest3.v3nt; +disconnect inv; +connection default; + +grant lock tables on mysqltest2.* to invoker@localhost; +connect inv,localhost,invoker; +error ER_VIEW_INVALID; +lock table mysqltest3.v3 write; +error ER_VIEW_INVALID; +lock table mysqltest3.v3i write; +disconnect inv; +connection default; + +grant lock tables on mysqltest1.* to definer@localhost; +connect inv,localhost,invoker; +lock table mysqltest3.v3 write; select * from mysqltest3.v3; +error ER_VIEW_INVALID; +lock table mysqltest3.v3i write; +disconnect inv; +connection default; + +grant lock tables on mysqltest1.* to invoker@localhost; +connect inv,localhost,invoker; +lock table mysqltest3.v3i write; select * from mysqltest3.v3i; +disconnect inv; +connection default; + +drop user invoker@localhost; +drop user definer@localhost; +drop database mysqltest1; +drop database mysqltest2; +drop database mysqltest3; diff --git a/mysql-test/main/order_by.result b/mysql-test/main/order_by.result index 806b7b9eea6..b1e510c5377 100644 --- a/mysql-test/main/order_by.result +++ b/mysql-test/main/order_by.result @@ -3509,6 +3509,26 @@ NULLIF(GROUP_CONCAT(v1), null) C B DROP TABLE t1; +# +# MDEV-24033: SIGSEGV in __memcmp_avx2_movbe from queue_insert | SIGSEGV in __memcmp_avx2_movbe from native_compare +# +SET @save_max_length_for_sort_data=@@max_length_for_sort_data; +SET @save_max_sort_length= @@max_sort_length; +SET @save_sql_select_limit= @@sql_select_limit; +CREATE TABLE t1 (a DECIMAL(64,0), b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +SET max_length_for_sort_data= 30; +SET sql_select_limit = 3; +SET max_sort_length=8; +SELECT * FROM t1 ORDER BY a+1; +a b +1 1 +2 2 +3 3 +SET max_length_for_sort_data=@save_max_length_for_sort_data; +SET max_sort_length= @save_max_sort_length; +SET sql_select_limit= @save_sql_select_limit; +DROP TABLE t1; # End of 10.2 tests # # MDEV-16214: Incorrect plan taken by the optimizer , uses INDEX instead of ref access with ORDER BY diff --git a/mysql-test/main/order_by.test b/mysql-test/main/order_by.test index 88d5250bb4c..9d0eaef5ea4 100644 --- a/mysql-test/main/order_by.test +++ b/mysql-test/main/order_by.test @@ -2274,6 +2274,27 @@ ORDER BY id+1 DESC; DROP TABLE t1; +--echo # +--echo # MDEV-24033: SIGSEGV in __memcmp_avx2_movbe from queue_insert | SIGSEGV in __memcmp_avx2_movbe from native_compare +--echo # + +SET @save_max_length_for_sort_data=@@max_length_for_sort_data; +SET @save_max_sort_length= @@max_sort_length; +SET @save_sql_select_limit= @@sql_select_limit; + +CREATE TABLE t1 (a DECIMAL(64,0), b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); + +SET max_length_for_sort_data= 30; +SET sql_select_limit = 3; +SET max_sort_length=8; +SELECT * FROM t1 ORDER BY a+1; + +SET max_length_for_sort_data=@save_max_length_for_sort_data; +SET max_sort_length= @save_max_sort_length; +SET sql_select_limit= @save_sql_select_limit; +DROP TABLE t1; + --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/plugin_innodb.test b/mysql-test/main/plugin_innodb.test index c0733570de1..d458299a900 100644 --- a/mysql-test/main/plugin_innodb.test +++ b/mysql-test/main/plugin_innodb.test @@ -1,13 +1,6 @@ --source include/not_embedded.inc --source include/have_example_plugin.inc ---source include/have_innodb.inc - -if (!`select count(*) from information_schema.plugins - where plugin_name = 'innodb' and plugin_status = 'active' and - plugin_library is null`) { - skip Need compiled-in InnoDB; -} - +--source include/have_static_innodb.inc install plugin example soname 'ha_example'; create table t1(a int) engine=example; diff --git a/mysql-test/main/pool_of_threads.result b/mysql-test/main/pool_of_threads.result index 617a6e98de7..d4a7d9092f4 100644 --- a/mysql-test/main/pool_of_threads.result +++ b/mysql-test/main/pool_of_threads.result @@ -2180,11 +2180,9 @@ connection extracon2; KILL QUERY <default_connection_ID>; KILL QUERY <con2_connection_ID>; connection default; -sleep(50) -1 +ERROR 70100: Query execution was interrupted connection con2; -sleep(50) -1 +ERROR 70100: Query execution was interrupted connection extracon; sleep(5.5) 0 diff --git a/mysql-test/main/pool_of_threads.test b/mysql-test/main/pool_of_threads.test index 95b320e6dad..3d581d4605d 100644 --- a/mysql-test/main/pool_of_threads.test +++ b/mysql-test/main/pool_of_threads.test @@ -86,8 +86,10 @@ eval KILL QUERY $con1_id; eval KILL QUERY $con2_id; connection default; +--error ER_QUERY_INTERRUPTED --reap connection con2; +--error ER_QUERY_INTERRUPTED --reap connection extracon; diff --git a/mysql-test/main/precedence.result b/mysql-test/main/precedence.result index f56f945c3fc..d5d4e662a8e 100644 --- a/mysql-test/main/precedence.result +++ b/mysql-test/main/precedence.result @@ -5919,14 +5919,14 @@ view_definition select 2 / 3 * 3 AS `2 / 3 * 3`,2 / (3 * 3) AS `2 / (3 * 3)`,2 / 3 * 3 AS `(2 / 3) * 3` select 2 / 3 * 3, 2 / (3 * 3), (2 / 3) * 3 union select * from v1; 2 / 3 * 3 2 / (3 * 3) (2 / 3) * 3 -2.0001 0.2222 2.0001 +2.0000 0.2222 2.0000 create or replace view v1 as select 2 / 3 / 3, 2 / (3 / 3), (2 / 3) / 3; Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; view_definition select 2 / 3 / 3 AS `2 / 3 / 3`,2 / (3 / 3) AS `2 / (3 / 3)`,2 / 3 / 3 AS `(2 / 3) / 3` select 2 / 3 / 3, 2 / (3 / 3), (2 / 3) / 3 union select * from v1; 2 / 3 / 3 2 / (3 / 3) (2 / 3) / 3 -0.22223333 2.0000 0.22223333 +0.22222222 2.0000 0.22222222 create or replace view v1 as select 2 / 3 DIV 3, 2 / (3 DIV 3), (2 / 3) DIV 3; Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; view_definition diff --git a/mysql-test/main/processlist_notembedded.result b/mysql-test/main/processlist_notembedded.result index b622fdf32b9..3c2671ff5e3 100644 --- a/mysql-test/main/processlist_notembedded.result +++ b/mysql-test/main/processlist_notembedded.result @@ -14,3 +14,16 @@ disconnect con1; connection default; SET DEBUG_SYNC = 'RESET'; End of 5.5 tests +# +# MDEV-23752: SHOW EXPLAIN FOR thd waits for sleep +# +connect con1,localhost,root,,; +select sleep(100000);; +connection default; +SHOW EXPLAIN FOR con_id; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sleep(100000) +KILL QUERY con_id; +# End of 10.2 tests diff --git a/mysql-test/main/processlist_notembedded.test b/mysql-test/main/processlist_notembedded.test index 6f269a816fc..26021040c39 100644 --- a/mysql-test/main/processlist_notembedded.test +++ b/mysql-test/main/processlist_notembedded.test @@ -40,3 +40,21 @@ SET DEBUG_SYNC = 'RESET'; source include/wait_until_count_sessions.inc; --echo End of 5.5 tests + +--echo # +--echo # MDEV-23752: SHOW EXPLAIN FOR thd waits for sleep +--echo # + +--connect (con1,localhost,root,,) +--let $con_id = `SELECT CONNECTION_ID()` +--send select sleep(100000); + +--connection default + +--replace_result $con_id con_id +eval SHOW EXPLAIN FOR $con_id; + +--replace_result $con_id con_id +eval KILL QUERY $con_id; + +--echo # End of 10.2 tests diff --git a/mysql-test/main/set_statement_notembedded.result b/mysql-test/main/set_statement_notembedded.result index 17cf2f63da9..67d2d8bc505 100644 --- a/mysql-test/main/set_statement_notembedded.result +++ b/mysql-test/main/set_statement_notembedded.result @@ -7,9 +7,8 @@ SLEEP(1) SHOW STATUS LIKE "max_statement_time_exceeded"; Variable_name Value Max_statement_time_exceeded 0 -SET STATEMENT MAX_STATEMENT_TIME=1 FOR SELECT SLEEP(3); -SLEEP(3) -1 +SET STATEMENT MAX_STATEMENT_TIME=1 FOR SELECT SLEEP(10); +ERROR 70100: Query execution was interrupted (max_statement_time exceeded) SHOW STATUS LIKE "max_statement_time_exceeded"; Variable_name Value Max_statement_time_exceeded 1 diff --git a/mysql-test/main/set_statement_notembedded.test b/mysql-test/main/set_statement_notembedded.test index 16488846fba..95d3efd40ca 100644 --- a/mysql-test/main/set_statement_notembedded.test +++ b/mysql-test/main/set_statement_notembedded.test @@ -6,7 +6,8 @@ SELECT @@MAX_STATEMENT_TIME; SET STATEMENT MAX_STATEMENT_TIME=3 FOR SELECT SLEEP(1); SHOW STATUS LIKE "max_statement_time_exceeded"; -SET STATEMENT MAX_STATEMENT_TIME=1 FOR SELECT SLEEP(3); +--error ER_STATEMENT_TIMEOUT +SET STATEMENT MAX_STATEMENT_TIME=1 FOR SELECT SLEEP(10); SHOW STATUS LIKE "max_statement_time_exceeded"; SELECT @@MAX_STATEMENT_TIME; diff --git a/mysql-test/main/subselect4.result b/mysql-test/main/subselect4.result index 3f12322f6dc..00f61e9433b 100644 --- a/mysql-test/main/subselect4.result +++ b/mysql-test/main/subselect4.result @@ -2596,7 +2596,7 @@ SELECT population, area, population/area, cast(population/area as DECIMAL(20,9)) FROM t1 LIMIT 1; population area population/area cast(population/area as DECIMAL(20,9)) -11797 91 129.6374 129.637400000 +11797 91 129.6374 129.637362637 SELECT * FROM t1 A WHERE population/area = (SELECT MAX(population/area) from t1 B where A.region = B.region); region area population diff --git a/mysql-test/main/type_newdecimal.result b/mysql-test/main/type_newdecimal.result index eac263296e2..13974c84e15 100644 --- a/mysql-test/main/type_newdecimal.result +++ b/mysql-test/main/type_newdecimal.result @@ -1532,8 +1532,11 @@ select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 * 1.01500000 * 1.01500000 * 0.99500000) 0.81298807395367312459230693948000000000 create table t1 as select 5.05 / 0.014; +Warnings: +Note 1265 Data truncated for column '5.05 / 0.014' at row 1 show warnings; Level Code Message +Note 1265 Data truncated for column '5.05 / 0.014' at row 1 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1648,6 +1651,8 @@ my_col 0.12345678912345678912345678912345678912 DROP TABLE t1; CREATE TABLE t1 SELECT 1 / .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS my_col; +Warnings: +Note 1265 Data truncated for column 'my_col' at row 1 DESCRIBE t1; Field Type Null Key Default Extra my_col decimal(65,4) YES NULL diff --git a/mysql-test/main/type_ranges.result b/mysql-test/main/type_ranges.result index 199c8a45c97..784a394d8b5 100644 --- a/mysql-test/main/type_ranges.result +++ b/mysql-test/main/type_ranges.result @@ -91,6 +91,8 @@ DROP INDEX test ON t1; insert into t1 values (10, 1,1,1,1,1,1,1,1,1,1,1,1,1,NULL,0,0,0,1,1,1,1,'one','one'); insert into t1 values (NULL,2,2,2,2,2,2,2,2,2,2,2,2,2,NULL,NULL,NULL,NULL,NULL,NULL,2,2,'two','two,one'); insert ignore into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303101010','','','','3',3,3); +Warnings: +Warning 1265 Data truncated for column 'string' at row 1 insert ignore into t1 values (0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,19970807,080706,19970403090807,-1,-1,-1,'-1',-1,-1); Warnings: Warning 1264 Out of range value for column 'utiny' at row 1 @@ -128,7 +130,7 @@ select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,ut auto string tiny short medium long_int longlong real_float real_double utiny ushort umedium ulong ulonglong mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000) date_field time_field date_time blob_col tinyblob_col mediumblob_col longblob_col 10 1 1 1 1 1 1 1.0 1.0000 1 00001 1 1 1 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 1 1 1 11 2 2 2 2 2 2 2.0 2.0000 2 00002 2 2 2 0 NULL NULL NULL NULL NULL 2 2 -12 0.3333 3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3 +12 0.33333333 3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3 13 -1 -1 -1 -1 -1 -1 -1.0 -1.0000 0 00000 0 0 0 0 1997-08-07 08:07:06 1997-04-03 09:08:07 -1 -1 -1 -1 14 -429496729 -128 -32768 -8388608 -2147483648 -4294967295 -4294967296.0 -4294967295.0000 0 00000 0 0 0 0 0000-00-00 00:00:00 0000-00-00 00:00:00 -4294967295 -4294967295 -4294967295 -4294967295 15 4294967295 127 32767 8388607 2147483647 4294967295 4294967296.0 4294967295.0000 255 65535 16777215 4294967295 4294967295 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4294967295 4294967295 4294967295 4294967295 @@ -180,7 +182,7 @@ Warning 1265 Data truncated for column 'new_field' at row 7 select * from t2; auto string mediumblob_col new_field 1 2 2 ne -2 0.3333 ne +2 0.33333333 ne 3 -1 -1 ne 4 -429496729 -4294967295 ne 5 4294967295 4294967295 ne |