mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Merge branch '10.1' into 10.2
This commit is contained in:
commit
65e26bc1ba
23 changed files with 510 additions and 76 deletions
|
|
@ -1,4 +0,0 @@
|
|||
disable_query_log;
|
||||
--require r/not_true.require
|
||||
select (PLUGIN_LIBRARY LIKE 'ha_innodb_plugin%' OR PLUGIN_DESCRIPTION LIKE '%xtradb%') as `TRUE` from information_schema.plugins where PLUGIN_NAME='InnoDB';
|
||||
enable_query_log;
|
||||
7
mysql-test/include/have_static_innodb.inc
Normal file
7
mysql-test/include/have_static_innodb.inc
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
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;
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
7
mysql-test/r/bootstrap_innodb.result
Normal file
7
mysql-test/r/bootstrap_innodb.result
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
create table t1(a int) engine=innodb;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
5
|
||||
drop table t1;
|
||||
231
mysql-test/r/lock_view.result
Normal file
231
mysql-test/r/lock_view.result
Normal file
|
|
@ -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;
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
TRUE
|
||||
NULL
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -37,5 +37,9 @@ SET @@GLOBAL.replicate_do_db=null;
|
|||
SELECT @@GLOBAL.replicate_do_db;
|
||||
@@GLOBAL.replicate_do_db
|
||||
|
||||
SET @@GLOBAL.replicate_do_db=DEFAULT;
|
||||
SELECT @@GLOBAL.replicate_do_db;
|
||||
@@GLOBAL.replicate_do_db
|
||||
|
||||
# Cleanup.
|
||||
SET @@GLOBAL.replicate_do_db = @save_replicate_do_db;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
include/master-slave.inc
|
||||
[connection master]
|
||||
connection slave;
|
||||
include/sync_slave_sql_with_master.inc
|
||||
SET @start_max_connections= @@global.max_connections;
|
||||
SET @start_init_slave= @@global.init_slave;
|
||||
SET NAMES utf8;
|
||||
|
|
@ -19,18 +19,12 @@ SELECT @@global.init_slave = 'SET @@global.max_connections = @@global.max_connec
|
|||
1
|
||||
Expect 1
|
||||
include/assert.inc [@@global.max_connections = @start_max_connections]
|
||||
STOP SLAVE;
|
||||
RESET MASTER;
|
||||
RESET SLAVE;
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
include/restart_slave.inc
|
||||
connection master;
|
||||
include/sync_slave_sql_with_master.inc
|
||||
include/assert.inc [@@global.max_connections = @start_max_connections + 1]
|
||||
SET @@global.init_slave = "SET @a=5";
|
||||
STOP SLAVE;
|
||||
RESET MASTER;
|
||||
RESET SLAVE;
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
include/restart_slave.inc
|
||||
SHOW VARIABLES LIKE 'init_slave';
|
||||
Variable_name Value
|
||||
init_slave SET @a=5
|
||||
|
|
|
|||
|
|
@ -38,5 +38,8 @@ SELECT @@GLOBAL.replicate_do_db;
|
|||
SET @@GLOBAL.replicate_do_db=null;
|
||||
SELECT @@GLOBAL.replicate_do_db;
|
||||
|
||||
SET @@GLOBAL.replicate_do_db=DEFAULT;
|
||||
SELECT @@GLOBAL.replicate_do_db;
|
||||
|
||||
--echo # Cleanup.
|
||||
SET @@GLOBAL.replicate_do_db = @save_replicate_do_db;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,13 @@
|
|||
###############################################################################
|
||||
|
||||
source include/master-slave.inc;
|
||||
connection slave;
|
||||
|
||||
# Since a part of slave SQL thread initialisation happens after Slave_SQL_Running
|
||||
# has been set to Yes, there is a race condition between initialisation above and
|
||||
# init_slave setting given below. Synchronise slave applier with master to ensure
|
||||
# init_slave is complete and applier had processed few events like FD.
|
||||
--source include/sync_slave_sql_with_master.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
|
||||
--enable_query_log
|
||||
|
|
@ -66,14 +72,15 @@ let $wait_condition= SELECT @@global.max_connections = @start_max_connections;
|
|||
--let $assert_text= @@global.max_connections = @start_max_connections
|
||||
--let $assert_cond= @@global.max_connections = @start_max_connections
|
||||
--source include/assert.inc
|
||||
#
|
||||
# reset of the server
|
||||
STOP SLAVE;
|
||||
--wait_for_slave_to_stop
|
||||
RESET MASTER;
|
||||
RESET SLAVE;
|
||||
START SLAVE;
|
||||
source include/wait_for_slave_to_start.inc;
|
||||
|
||||
--source include/restart_slave_sql.inc
|
||||
|
||||
# Upon slave start, sync the applier with master, to ensure slave has
|
||||
# completed init_slave command execution and processed FD event from the
|
||||
# master.
|
||||
--connection master
|
||||
--source include/sync_slave_sql_with_master.inc
|
||||
|
||||
#
|
||||
# wait for the slave threads have set the global variable.
|
||||
let $wait_timeout= 90;
|
||||
|
|
@ -87,12 +94,7 @@ let $wait_condition= SELECT @@global.max_connections = @start_max_connections +
|
|||
# Setting a variable(which is local to a session) and must not be visible
|
||||
SET @@global.init_slave = "SET @a=5";
|
||||
#
|
||||
STOP SLAVE;
|
||||
--wait_for_slave_to_stop
|
||||
RESET MASTER;
|
||||
RESET SLAVE;
|
||||
START SLAVE;
|
||||
source include/wait_for_slave_to_start.inc;
|
||||
--source include/restart_slave_sql.inc
|
||||
#
|
||||
SHOW VARIABLES LIKE 'init_slave';
|
||||
# expect NULL
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
27
mysql-test/t/bootstrap_innodb.test
Normal file
27
mysql-test/t/bootstrap_innodb.test
Normal file
|
|
@ -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;
|
||||
76
mysql-test/t/lock_view.test
Normal file
76
mysql-test/t/lock_view.test
Normal file
|
|
@ -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;
|
||||
|
|
@ -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
|
||||
|
||||
--replace_regex /\.dll/.so/
|
||||
eval install plugin example soname '$HA_EXAMPLE_SO';
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue