mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
merge from 5.5-merge
This commit is contained in:
@ -334,7 +334,7 @@ INSERT INTO t1 VALUES (1), (1);
|
||||
|
||||
CREATE TABLE t2 ( a INT AUTO_INCREMENT KEY );
|
||||
--error ER_DUP_ENTRY
|
||||
CREATE TABLE IF NOT EXISTS t2 AS SELECT a FROM t1;
|
||||
INSERT INTO t2 SELECT a FROM t1;
|
||||
|
||||
UPDATE t2 SET a = 2;
|
||||
|
||||
|
@ -111,6 +111,9 @@ explain extended SELECT
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--error 1267
|
||||
CREATE TABLE t1 SELECT IFNULL('a' COLLATE latin1_swedish_ci, 'b' COLLATE latin1_bin);
|
||||
|
||||
# Test for BUG#10151
|
||||
SELECT 'case+union+test'
|
||||
UNION
|
||||
|
@ -5,6 +5,7 @@
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t3,t4,t5;
|
||||
drop database if exists mysqltest;
|
||||
drop view if exists v1;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (b char(0));
|
||||
@ -232,7 +233,6 @@ drop table t1;
|
||||
|
||||
create table t1 select 1,2,3;
|
||||
create table if not exists t1 select 1,2;
|
||||
--error 1136
|
||||
create table if not exists t1 select 1,2,3,4;
|
||||
create table if not exists t1 select 1;
|
||||
select * from t1;
|
||||
@ -248,8 +248,6 @@ insert into t1 values (1,1);
|
||||
create table if not exists t1 select 2;
|
||||
select * from t1;
|
||||
create table if not exists t1 select 3 as 'a',4 as 'b';
|
||||
--error ER_DUP_ENTRY
|
||||
create table if not exists t1 select 3 as 'a',3 as 'b';
|
||||
show warnings;
|
||||
show status like "Opened_tables";
|
||||
select * from t1;
|
||||
@ -517,7 +515,7 @@ drop table t1,t2;
|
||||
# an improper fix is present.
|
||||
#
|
||||
create table t1 (a int);
|
||||
--error 1093
|
||||
--error ER_TABLE_EXISTS_ERROR
|
||||
create table t1 select * from t1;
|
||||
--error ER_WRONG_OBJECT
|
||||
create table t2 union = (t1) select * from t1;
|
||||
@ -730,7 +728,6 @@ create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1
|
||||
create table t1 (primary key(a)) select "b" as b;
|
||||
# Error in select_create::prepare() which is not related to table creation
|
||||
create table t1 (a int);
|
||||
--error ER_WRONG_VALUE_COUNT_ON_ROW
|
||||
create table if not exists t1 select 1 as a, 2 as b;
|
||||
drop table t1;
|
||||
# Finally error which happens during insert
|
||||
@ -742,20 +739,13 @@ create table t1 (i int);
|
||||
create table t1 select 1 as i;
|
||||
create table if not exists t1 select 1 as i;
|
||||
select * from t1;
|
||||
# Error which is detected after successfull table open.
|
||||
--error ER_UPDATE_TABLE_USED
|
||||
# After WL#5370, it just generates a warning that the table already exists.
|
||||
create table if not exists t1 select * from t1;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
# Error before select_create::prepare()
|
||||
--error ER_CANT_AGGREGATE_2COLLATIONS
|
||||
create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
|
||||
select * from t1;
|
||||
# Error which happens during insertion of rows
|
||||
alter table t1 add primary key (i);
|
||||
--error ER_DUP_ENTRY
|
||||
create table if not exists t1 (select 2 as i) union all (select 2 as i);
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
|
||||
# Base vs temporary tables dillema (a.k.a. bug#24508 "Inconsistent
|
||||
@ -1229,11 +1219,9 @@ INSERT IGNORE INTO t1 (b) VALUES (5);
|
||||
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
|
||||
SELECT a FROM t1;
|
||||
--error 1062
|
||||
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
|
||||
SELECT a FROM t1;
|
||||
INSERT INTO t2 SELECT a FROM t1;
|
||||
--error 1062
|
||||
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
|
||||
SELECT a FROM t1;
|
||||
INSERT INTO t2 SELECT a FROM t1;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
@ -1273,7 +1261,7 @@ CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1;
|
||||
drop table if exists t2;
|
||||
CREATE TABLE t2 (a int, b int, primary key (a));
|
||||
--error ER_DUP_ENTRY
|
||||
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
|
||||
INSERT INTO t2 select * from t1;
|
||||
SELECT * from t2;
|
||||
TRUNCATE table t2;
|
||||
--error ER_DUP_ENTRY
|
||||
@ -1283,11 +1271,7 @@ drop table t2;
|
||||
|
||||
CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a));
|
||||
--error ER_DUP_ENTRY
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
|
||||
SELECT * from t2;
|
||||
TRUNCATE table t2;
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO t2 select * from t1;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
SELECT * from t2;
|
||||
drop table t1,t2;
|
||||
|
||||
@ -1657,11 +1641,7 @@ END ; |
|
||||
|
||||
--delimiter ;
|
||||
--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
|
||||
CREATE TABLE IF NOT EXISTS t1 (
|
||||
`pk` INTEGER NOT NULL AUTO_INCREMENT ,
|
||||
`int` INTEGER ,
|
||||
PRIMARY KEY ( `pk` )
|
||||
) SELECT `pk` , `int_key` FROM B ;
|
||||
INSERT INTO t1 (pk, int_key) SELECT `pk` , `int_key` FROM B ;
|
||||
|
||||
--delimiter |
|
||||
--error ER_NOT_SUPPORTED_YET
|
||||
@ -1675,7 +1655,6 @@ END ;|
|
||||
DROP TABLE t1;
|
||||
DROP TABLE B;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #47107 assert in notify_shared_lock on incorrect
|
||||
--echo # CREATE TABLE , HANDLER
|
||||
@ -1798,3 +1777,243 @@ show create table t1;
|
||||
show create table t2;
|
||||
set @@sql_mode= @old_mode;
|
||||
drop tables t1, t2;
|
||||
#
|
||||
# Bug#47132 CREATE TABLE.. SELECT.. data not inserted if table
|
||||
# is view over multiple tables
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (id int);
|
||||
CREATE TABLE t2 (id int);
|
||||
INSERT INTO t1 VALUES (1), (1);
|
||||
INSERT INTO t2 VALUES (2), (2);
|
||||
|
||||
CREATE VIEW v1 AS SELECT id FROM t2;
|
||||
CREATE TABLE IF NOT EXISTS v1(a int, b int) SELECT id, id FROM t1;
|
||||
SHOW CREATE TABLE v1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM v1;
|
||||
DROP VIEW v1;
|
||||
|
||||
CREATE TEMPORARY TABLE tt1 AS SELECT id FROM t2;
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS tt1(a int, b int) SELECT id, id FROM t1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM tt1;
|
||||
DROP TEMPORARY TABLE tt1;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # WL#5370 "Changing 'CREATE TABLE IF NOT EXISTS ... SELECT'
|
||||
--echo # behaviour.
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # 1. Basic case: a base table.
|
||||
--echo #
|
||||
|
||||
create table if not exists t1 (a int) select 1 as a;
|
||||
select * from t1;
|
||||
--error ER_TABLE_EXISTS_ERROR
|
||||
create table t1 (a int) select 2 as a;
|
||||
select * from t1;
|
||||
--echo # Produces an essential warning ER_TABLE_EXISTS.
|
||||
create table if not exists t1 (a int) select 2 as a;
|
||||
--echo # No new data in t1.
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # 2. A temporary table.
|
||||
--echo #
|
||||
|
||||
create temporary table if not exists t1 (a int) select 1 as a;
|
||||
select * from t1;
|
||||
--error ER_TABLE_EXISTS_ERROR
|
||||
create temporary table t1 (a int) select 2 as a;
|
||||
select * from t1;
|
||||
--echo # An essential warning.
|
||||
create temporary table if not exists t1 (a int) select 2 as a;
|
||||
--echo # No new data in t1.
|
||||
select * from t1;
|
||||
drop temporary table t1;
|
||||
|
||||
--echo #
|
||||
--echo # 3. Creating a base table in presence of a temporary table.
|
||||
--echo #
|
||||
|
||||
create table t1 (a int);
|
||||
--echo # Create a view for convenience of querying t1 shadowed by a temp.
|
||||
create view v1 as select a from t1;
|
||||
drop table t1;
|
||||
create temporary table t1 (a int) select 1 as a;
|
||||
create table if not exists t1 (a int) select 2 as a;
|
||||
select * from t1;
|
||||
select * from v1;
|
||||
--echo # Note: an essential warning.
|
||||
create table if not exists t1 (a int) select 3 as a;
|
||||
select * from t1;
|
||||
select * from v1;
|
||||
drop temporary table t1;
|
||||
select * from t1;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # 4. Creating a temporary table in presence of a base table.
|
||||
--echo #
|
||||
|
||||
create table t1 (a int) select 1 as a;
|
||||
create temporary table if not exists t1 select 2 as a;
|
||||
select * from t1;
|
||||
--echo # Note: an essential warning.
|
||||
create temporary table if not exists t1 select 3 as a;
|
||||
select * from t1;
|
||||
drop temporary table t1;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # 5. Creating a base table in presence of an updatable view.
|
||||
--echo #
|
||||
create table t2 (a int unique);
|
||||
create view t1 as select a from t2;
|
||||
insert into t1 (a) values (1);
|
||||
--error ER_TABLE_EXISTS_ERROR
|
||||
create table t1 (a int);
|
||||
--echo # Note: an essential warning.
|
||||
create table if not exists t1 (a int);
|
||||
--error ER_TABLE_EXISTS_ERROR
|
||||
create table t1 (a int) select 2 as a;
|
||||
select * from t1;
|
||||
--echo # Note: an essential warning.
|
||||
create table if not exists t1 (a int) select 2 as a;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
create temporary table if not exists t1 (a int) select 3 as a;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
--echo # Note: an essential warning.
|
||||
create temporary table if not exists t1 (a int) select 4 as a;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
drop temporary table t1;
|
||||
|
||||
--echo #
|
||||
--echo # Repeating the test with a non-updatable view.
|
||||
--echo #
|
||||
drop view t1;
|
||||
create view t1 as select a + 5 as a from t2;
|
||||
--error ER_NON_INSERTABLE_TABLE
|
||||
insert into t1 (a) values (1);
|
||||
--error ER_NONUPDATEABLE_COLUMN
|
||||
update t1 set a=3 where a=2;
|
||||
|
||||
--error ER_TABLE_EXISTS_ERROR
|
||||
create table t1 (a int);
|
||||
--echo # Note: an essential warning.
|
||||
create table if not exists t1 (a int);
|
||||
--error ER_TABLE_EXISTS_ERROR
|
||||
create table t1 (a int) select 2 as a;
|
||||
select * from t1;
|
||||
--echo # Note: an essential warning.
|
||||
create table if not exists t1 (a int) select 2 as a;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
create temporary table if not exists t1 (a int) select 3 as a;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
--echo # Note: an essential warning.
|
||||
create temporary table if not exists t1 (a int) select 4 as a;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
drop temporary table t1;
|
||||
drop view t1;
|
||||
drop table t2;
|
||||
|
||||
--echo #
|
||||
--echo # Repeating the test with a view select a constant number
|
||||
--echo #
|
||||
create view t1 as select 1 as a;
|
||||
--error ER_NON_INSERTABLE_TABLE
|
||||
insert into t1 (a) values (1);
|
||||
--error ER_NON_UPDATABLE_TABLE
|
||||
update t1 set a=3 where a=2;
|
||||
|
||||
--error ER_TABLE_EXISTS_ERROR
|
||||
create table t1 (a int);
|
||||
--echo # Note: an essential warning.
|
||||
create table if not exists t1 (a int);
|
||||
--error ER_TABLE_EXISTS_ERROR
|
||||
create table t1 (a int) select 2 as a;
|
||||
select * from t1;
|
||||
--echo # Note: an essential warning.
|
||||
create table if not exists t1 (a int) select 2 as a;
|
||||
select * from t1;
|
||||
create temporary table if not exists t1 (a int) select 3 as a;
|
||||
select * from t1;
|
||||
--echo # Note: an essential warning.
|
||||
create temporary table if not exists t1 (a int) select 4 as a;
|
||||
select * from t1;
|
||||
drop temporary table t1;
|
||||
drop view t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # 6. Test of unique_table().
|
||||
--echo #
|
||||
|
||||
create table t1 (a int) select 1 as a;
|
||||
create temporary table if not exists t1 (a int) select * from t1;
|
||||
--error ER_CANT_REOPEN_TABLE
|
||||
create temporary table if not exists t1 (a int) select * from t1;
|
||||
select * from t1;
|
||||
drop temporary table t1;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
create temporary table t1 (a int) select 1 as a;
|
||||
create table if not exists t1 (a int) select * from t1;
|
||||
create table if not exists t1 (a int) select * from t1;
|
||||
select * from t1;
|
||||
drop temporary table t1;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
create table if not exists t1 (a int) select * from t1;
|
||||
|
||||
--echo #
|
||||
--echo # 7. Test of non-matching columns, REPLACE and IGNORE.
|
||||
--echo #
|
||||
|
||||
create table t1 (a int) select 1 as b, 2 as c;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
create table if not exists t1 (a int, b date, c date) select 1 as b, 2 as c;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
set @@session.sql_mode='STRICT_ALL_TABLES';
|
||||
--error ER_TRUNCATED_WRONG_VALUE
|
||||
create table if not exists t1 (a int, b date, c date) select 1 as b, 2 as c;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
select * from t1;
|
||||
--error ER_TRUNCATED_WRONG_VALUE
|
||||
create table if not exists t1 (a int, b date, c date)
|
||||
replace select 1 as b, 2 as c;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
select * from t1;
|
||||
|
||||
create table if not exists t1 (a int, b date, c date)
|
||||
ignore select 1 as b, 2 as c;
|
||||
select * from t1;
|
||||
set @@session.sql_mode=default;
|
||||
drop table t1;
|
||||
|
||||
create table if not exists t1 (a int unique, b int)
|
||||
replace select 1 as a, 1 as b union select 1 as a, 2 as b;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
create table if not exists t1 (a int unique, b int)
|
||||
ignore select 1 as a, 1 as b union select 1 as a, 2 as b;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
--echo #
|
||||
|
1
mysql-test/t/ctype_utf16_def-master.opt
Normal file
1
mysql-test/t/ctype_utf16_def-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--character-set-server=utf16,latin1
|
8
mysql-test/t/ctype_utf16_def.test
Normal file
8
mysql-test/t/ctype_utf16_def.test
Normal file
@ -0,0 +1,8 @@
|
||||
--source include/have_utf16.inc
|
||||
|
||||
#
|
||||
# Bug #32391 Character sets: crash with --character-set-server
|
||||
#
|
||||
SHOW VARIABLES LIKE 'collation_server';
|
||||
SHOW VARIABLES LIKE 'character_set_server';
|
||||
SHOW VARIABLES LIKE 'ft_stopword_file';
|
@ -800,6 +800,35 @@ CREATE TABLE t2 AS SELECT CONCAT(s1) FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#45263 utf32_general_ci, bad effects around CREATE TABLE AS SELECT
|
||||
--echo #
|
||||
SET collation_connection=utf32_general_ci;
|
||||
CREATE TABLE t1 AS SELECT HEX(0x00) AS my_col;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#55912 FORMAT with locale set fails for numbers < 1000
|
||||
--echo #
|
||||
SET collation_connection=utf32_general_ci;
|
||||
CREATE TABLE t1 AS SELECT format(123,2,'no_NO');
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#42511 mysqld: ctype-ucs2.c:2044: my_strnncollsp_utf32: Assertion (tlen % 4) == 0' faied
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
b char(250) CHARACTER SET utf32,
|
||||
key (b)
|
||||
) ENGINE=MYISAM;
|
||||
INSERT INTO t1 VALUES ('d'),('f');
|
||||
SELECT * FROM t1 WHERE b BETWEEN 'a' AND 'z';
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 5.5 tests
|
||||
--echo #
|
||||
|
@ -1505,6 +1505,11 @@ CREATE TABLE t2 AS SELECT CONCAT(s1) FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
|
||||
SET NAMES utf8;
|
||||
--source include/ctype_numconv.inc
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # End of 5.5 tests
|
||||
--echo #
|
||||
|
@ -307,7 +307,7 @@ connection update;
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where command = "Delayed insert" and state = "Table lock";
|
||||
where command = "Delayed insert" and state = "Waiting for table level lock";
|
||||
--source include/wait_condition.inc
|
||||
connect (select,localhost,root,,);
|
||||
--echo connection: select
|
||||
@ -388,3 +388,167 @@ CREATE TABLE t1 LIKE t2;
|
||||
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#54332 Deadlock with two connections doing LOCK TABLE+INSERT DELAYED
|
||||
--echo #
|
||||
|
||||
--echo # This test is not supposed to work under --ps-protocol since
|
||||
--echo # INSERT DELAYED doesn't work under LOCK TABLES with this protocol.
|
||||
--disable_ps_protocol
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (a INT);
|
||||
CREATE TABLE t3 (a INT);
|
||||
|
||||
--echo # Test 1: Using LOCK TABLE
|
||||
|
||||
--echo # Connection con1
|
||||
connect (con1, localhost, root);
|
||||
LOCK TABLE t1 WRITE;
|
||||
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
LOCK TABLE t2 WRITE;
|
||||
--echo # Sending:
|
||||
--send INSERT DELAYED INTO t1 VALUES (1)
|
||||
|
||||
--echo # Connection con1
|
||||
connection con1;
|
||||
--echo # Wait until INSERT DELAYED is blocked on table 't1'.
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist
|
||||
WHERE state = "Waiting for table metadata lock"
|
||||
AND info = "INSERT DELAYED INTO t1 VALUES (1)";
|
||||
--source include/wait_condition.inc
|
||||
--error ER_LOCK_DEADLOCK
|
||||
INSERT DELAYED INTO t2 VALUES (1);
|
||||
UNLOCK TABLES;
|
||||
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
--echo # Reaping: INSERT DELAYED INTO t1 VALUES (1)
|
||||
--reap
|
||||
UNLOCK TABLES;
|
||||
|
||||
--echo # Test 2: Using ALTER TABLE
|
||||
|
||||
START TRANSACTION;
|
||||
SELECT * FROM t1 WHERE a=0;
|
||||
|
||||
--echo # Connection con1
|
||||
connection con1;
|
||||
--echo # Sending:
|
||||
--send ALTER TABLE t1 COMMENT 'test'
|
||||
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
--echo # Wait until ALTER TABLE is blocked on table 't1'.
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist
|
||||
WHERE state = "Waiting for table metadata lock"
|
||||
AND info = "ALTER TABLE t1 COMMENT 'test'";
|
||||
--source include/wait_condition.inc
|
||||
--error ER_LOCK_DEADLOCK
|
||||
INSERT DELAYED INTO t1 VALUES (3);
|
||||
COMMIT;
|
||||
|
||||
--echo # Connection con1
|
||||
connection con1;
|
||||
--echo # Reaping: ALTER TABLE t1 COMMENT 'test'
|
||||
--reap
|
||||
|
||||
--echo # Test 3: Using RENAME TABLE
|
||||
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t2 VALUES (1);
|
||||
|
||||
--echo # Connection con1
|
||||
connection con1;
|
||||
--echo # Sending:
|
||||
--send RENAME TABLE t1 to t5, t2 to t4
|
||||
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
--echo # Wait until RENAME TABLE is blocked on table 't1'.
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist
|
||||
WHERE state = "Waiting for table metadata lock"
|
||||
AND info = "RENAME TABLE t1 to t5, t2 to t4";
|
||||
--source include/wait_condition.inc
|
||||
--error ER_LOCK_DEADLOCK
|
||||
INSERT DELAYED INTO t1 VALUES (4);
|
||||
COMMIT;
|
||||
|
||||
--echo # Connection con1
|
||||
connection con1;
|
||||
--echo # Reaping: RENAME TABLE t1 to t5, t2 to t4
|
||||
--reap
|
||||
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
--echo # Reverting the renames
|
||||
RENAME TABLE t5 to t1, t4 to t2;
|
||||
|
||||
--echo # Test 4: Two INSERT DELAYED on the same table
|
||||
|
||||
START TRANSACTION;
|
||||
INSERT INTO t2 VALUES (1);
|
||||
|
||||
--echo # Connection con2
|
||||
connect (con2, localhost, root);
|
||||
--send LOCK TABLE t1 WRITE, t2 WRITE
|
||||
|
||||
--echo # Connection con1
|
||||
connection con1;
|
||||
--echo # Wait until LOCK TABLE is blocked on table 't2'.
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist
|
||||
WHERE state = "Waiting for table metadata lock"
|
||||
AND info = "LOCK TABLE t1 WRITE, t2 WRITE";
|
||||
--source include/wait_condition.inc
|
||||
--send INSERT DELAYED INTO t1 VALUES (5)
|
||||
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
--echo # Wait until INSERT DELAYED is blocked on table 't1'.
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist
|
||||
WHERE state = "Waiting for table metadata lock"
|
||||
AND info = "INSERT DELAYED INTO t1 VALUES (5)";
|
||||
--source include/wait_condition.inc
|
||||
--error ER_LOCK_DEADLOCK
|
||||
INSERT DELAYED INTO t1 VALUES (6);
|
||||
COMMIT;
|
||||
|
||||
--echo # Connection con2
|
||||
connection con2;
|
||||
--echo # Reaping: LOCK TABLE t1 WRITE, t2 WRITE
|
||||
--reap
|
||||
UNLOCK TABLES;
|
||||
|
||||
--echo # Connection con1
|
||||
connection con1;
|
||||
--echo # Reaping: INSERT DELAYED INTO t1 VALUES (5)
|
||||
--reap
|
||||
|
||||
--echo # Connection con2
|
||||
connection con2;
|
||||
disconnect con2;
|
||||
--source include/wait_until_disconnected.inc
|
||||
--echo # Connection con1
|
||||
connection con1;
|
||||
disconnect con1;
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
DROP TABLE t1, t2, t3;
|
||||
--enable_ps_protocol
|
||||
|
@ -540,4 +540,17 @@ DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #53034: Multiple-table DELETE statements not accepting
|
||||
--echo # "Access compatibility" syntax
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (id INT);
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
CREATE TABLE t3 LIKE t1;
|
||||
|
||||
DELETE FROM t1.*, test.t2.*, a.* USING t1, t2, t3 AS a;
|
||||
|
||||
DROP TABLE t1, t2, t3;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -11,11 +11,10 @@
|
||||
##############################################################################
|
||||
kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
|
||||
lowercase_table3 : Bug#54845 2010-06-30 alik main.lowercase_table3 on Mac OSX
|
||||
mysqlhotcopy_myisam : bug#54129 2010-06-04 Horst
|
||||
mysqlhotcopy_archive : bug#54129 2010-06-04 Horst
|
||||
partition_innodb_plugin : Bug#53307 2010-04-30 VasilDimov valgrind warnings
|
||||
plugin : Bug#55966 2010-08-13 alik "plugin" tests fail in 5.5
|
||||
plugin_load : Bug#55966 2010-08-13 alik "plugin" tests fail in 5.5
|
||||
plugin_not_embedded : Bug#55966 2010-08-13 alik "plugin" tests fail in 5.5
|
||||
query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically
|
||||
sp_sync : Bug#48157 2010-02-06 5.5-m3 demands a differnt solution
|
||||
ctype_utf8mb4_ndb : Bug#55799, Bug#51907, disabled by Konstantin 2010-08-06
|
||||
|
@ -27,7 +27,7 @@ alter table t1 modify text1 char(32) binary not null;
|
||||
check table t1;
|
||||
select * from t1 ignore key (key1) where text1='teststring' or
|
||||
text1 like 'teststring_%' ORDER BY text1;
|
||||
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
|
||||
select concat('|', text1, '|') as c from t1 where text1='teststring' or text1 like 'teststring_%' order by c;
|
||||
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
|
||||
select text1, length(text1) from t1 order by text1;
|
||||
select text1, length(text1) from t1 order by binary text1;
|
||||
@ -44,14 +44,14 @@ select concat('|', text1, '|') from t1 where text1='teststring';
|
||||
select concat('|', text1, '|') from t1 where text1='teststring ';
|
||||
explain select concat('|', text1, '|') from t1 where text1='teststring ';
|
||||
select concat('|', text1, '|') from t1 where text1 like 'teststring_%';
|
||||
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
|
||||
select concat('|', text1, '|') as c from t1 where text1='teststring' or text1 like 'teststring_%' order by c;
|
||||
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
|
||||
select concat('|', text1, '|') from t1 order by text1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) pack_keys=0;
|
||||
insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
|
||||
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
|
||||
select concat('|', text1, '|') as c from t1 where text1='teststring' or text1 like 'teststring_%' order by c;
|
||||
select concat('|', text1, '|') from t1 where text1='teststring' or text1 >= 'teststring\t';
|
||||
drop table t1;
|
||||
|
||||
|
@ -121,3 +121,28 @@ let $wait_condition=
|
||||
|
||||
drop database events_test;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#54105 assert in MDL_context::release_locks_stored_before
|
||||
--echo #
|
||||
|
||||
USE test;
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP EVENT IF EXISTS e1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT);
|
||||
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
|
||||
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
SAVEPOINT A;
|
||||
--replace_regex /STARTS '[^']+'/STARTS '#'/
|
||||
SHOW CREATE EVENT e1;
|
||||
SELECT * FROM t2;
|
||||
ROLLBACK WORK TO SAVEPOINT A;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
@ -318,6 +318,58 @@ insert into t2 (a) values (3);
|
||||
--echo # --> connection default;
|
||||
connection default;
|
||||
unlock tables;
|
||||
--echo #
|
||||
--echo # Check that "FLUSH TABLES <list> WITH READ LOCK" is
|
||||
--echo # compatible with active "FLUSH TABLES WITH READ LOCK".
|
||||
--echo # Vice versa it is not true, since tables read-locked by
|
||||
--echo # "FLUSH TABLES <list> WITH READ LOCK" can't be flushed.
|
||||
flush tables with read lock;
|
||||
--echo # --> connection con1;
|
||||
connection con1;
|
||||
flush table t1 with read lock;
|
||||
select * from t1;
|
||||
unlock tables;
|
||||
--echo # --> connection default;
|
||||
connection default;
|
||||
unlock tables;
|
||||
--echo #
|
||||
--echo # Check that FLUSH TABLES t1 WITH READ LOCK
|
||||
--echo # does not conflict with an existing FLUSH TABLES t2
|
||||
--echo # WITH READ LOCK.
|
||||
--echo #
|
||||
flush table t1 with read lock;
|
||||
--echo # --> connection con1
|
||||
connection con1;
|
||||
flush table t2 with read lock;
|
||||
unlock tables;
|
||||
--echo # --> connection default
|
||||
connection default;
|
||||
unlock tables;
|
||||
--echo #
|
||||
--echo # Check that FLUSH TABLES t1 WITH READ LOCK
|
||||
--echo # does not conflict with SET GLOBAL read_only=1.
|
||||
--echo #
|
||||
set global read_only=1;
|
||||
--echo # connection con1
|
||||
connection con1;
|
||||
flush table t1 with read lock;
|
||||
unlock tables;
|
||||
--echo # connection default
|
||||
connection default;
|
||||
set global read_only=0;
|
||||
--echo #
|
||||
--echo # Check that it's possible to read-lock
|
||||
--echo # tables locked with FLUSH TABLE <list> WITH READ LOCK.
|
||||
--echo #
|
||||
flush tables t1, t2 with read lock;
|
||||
--echo # connection con1
|
||||
connection con1;
|
||||
lock table t1 read, t2 read;
|
||||
unlock tables;
|
||||
--echo # connection default
|
||||
connection default;
|
||||
unlock tables;
|
||||
|
||||
--echo # --> connection con1
|
||||
connection con1;
|
||||
disconnect con1;
|
||||
@ -355,3 +407,142 @@ drop temporary table v1;
|
||||
unlock tables;
|
||||
drop view v2, v3;
|
||||
drop table t1, v1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # FLUSH TABLES <list> WITH READ LOCK and HANDLER
|
||||
--echo #
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
create table t1 (a int, key a (a));
|
||||
insert into t1 (a) values (1), (2), (3);
|
||||
handler t1 open;
|
||||
handler t1 read a next;
|
||||
handler t1 read a next;
|
||||
flush tables t1 with read lock;
|
||||
--error ER_LOCK_OR_ACTIVE_TRANSACTION
|
||||
handler t1 read a next;
|
||||
unlock tables;
|
||||
--echo #
|
||||
--echo # Sic: lost handler position.
|
||||
--echo #
|
||||
handler t1 read a next;
|
||||
handler t1 close;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#52117 Pending FLUSH TALBES <list> aborts
|
||||
--echo # transactions unnecessarily.
|
||||
--echo #
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
--echo # --> conection default
|
||||
connection default;
|
||||
|
||||
create table t1 (a int);
|
||||
begin;
|
||||
select * from t1;
|
||||
--echo # --> connection con1
|
||||
connection con1;
|
||||
--echo #
|
||||
--echo # Issue a LOCK TABLE t1 READ. We could use HANDLER t1 OPEN
|
||||
--echo # or a long-running select -- anything that
|
||||
--echo # prevents FLUSH TABLE t1 from immediate completion would do.
|
||||
--echo #
|
||||
lock table t1 read;
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo #
|
||||
--echo # FLUSH TABLE expels the table definition from the cache.
|
||||
--echo # Sending 'flush table t1'...
|
||||
send flush table t1;
|
||||
--echo # --> connection default
|
||||
connection default;
|
||||
--echo # Let flush table sync in.
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table flush"
|
||||
and info = "flush table t1";
|
||||
--source include/wait_condition.inc
|
||||
send select * from t1;
|
||||
--echo # --> connection con1
|
||||
connection con1;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table flush"
|
||||
and info = "select * from t1";
|
||||
select * from t1;
|
||||
unlock tables;
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo # Reaping 'flush table t1'...
|
||||
reap;
|
||||
--echo # --> connection default
|
||||
connection default;
|
||||
--echo # Reaping 'select * from t1'...
|
||||
reap;
|
||||
commit;
|
||||
|
||||
--echo #
|
||||
--echo # Repeat the same test but with FLUSH TABLES
|
||||
--echo #
|
||||
|
||||
begin;
|
||||
select * from t1;
|
||||
--echo # --> connection con1
|
||||
connection con1;
|
||||
--echo #
|
||||
--echo # Issue a LOCK TABLE t1 READ.
|
||||
--echo #
|
||||
lock table t1 read;
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo #
|
||||
--echo # FLUSH TABLES expels the table definition from the cache.
|
||||
--echo # Sending 'flush tables'...
|
||||
send flush tables;
|
||||
--echo # --> connection default
|
||||
connection default;
|
||||
--echo # Let flush table sync in.
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table flush"
|
||||
and info = "flush tables";
|
||||
--source include/wait_condition.inc
|
||||
send select * from t1;
|
||||
--echo # --> connection con1
|
||||
connection con1;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table flush"
|
||||
and info = "select * from t1";
|
||||
select * from t1;
|
||||
unlock tables;
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo # Reaping 'flush tables'...
|
||||
reap;
|
||||
--echo # --> connection default
|
||||
connection default;
|
||||
--echo # Reaping 'select * from t1'...
|
||||
reap;
|
||||
commit;
|
||||
|
||||
--echo # Cleanup
|
||||
|
||||
--echo # --> connection con1
|
||||
connection con1;
|
||||
disconnect con1;
|
||||
--source include/wait_until_disconnected.inc
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
disconnect con2;
|
||||
--source include/wait_until_disconnected.inc
|
||||
--echo # --> connection default
|
||||
connection default;
|
||||
drop table t1;
|
||||
|
||||
|
@ -1082,11 +1082,25 @@ select a.f1 as a, b.f4 as b, a.f1 > b.f4 as gt,
|
||||
from t1 a, t1 b;
|
||||
select *, f1 = f2 from t1;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #54465: assert: field_types == 0 || field_types[field_pos] ==
|
||||
--echo # MYSQL_TYPE_LONGLONG
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
|
||||
SELECT MAX((SELECT 1 FROM t1 ORDER BY @var LIMIT 1)) m FROM t1 t2, t1
|
||||
ORDER BY t1.a;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo End of 5.1 tests
|
||||
|
||||
--echo #
|
||||
--echo # Bug#55648: Server crash on MIX/MAX on maximum time value
|
||||
--echo # Bug#55648: Server crash on MIN/MAX on maximum time value
|
||||
--echo #
|
||||
CREATE TABLE t1(c1 TIME NOT NULL);
|
||||
INSERT INTO t1 VALUES('837:59:59');
|
||||
@ -1095,3 +1109,12 @@ SELECT MAX(c1) FROM t1;
|
||||
DROP TABLE t1;
|
||||
--echo # End of the bug#55648
|
||||
|
||||
--echo #
|
||||
--echo # Bug#56120: Failed assertion on MIN/MAX on negative time value
|
||||
--echo #
|
||||
CREATE TABLE t1(c1 TIME NOT NULL);
|
||||
INSERT INTO t1 VALUES('-00:00:01');
|
||||
SELECT MAX(c1),MIN(c1) FROM t1;
|
||||
DROP TABLE t1;
|
||||
--echo # End of the bug#56120
|
||||
|
||||
|
@ -1404,3 +1404,20 @@ SELECT format(123, 1, 'Non-existent-locale');
|
||||
|
||||
--echo End of 5.4 tests
|
||||
|
||||
--echo #
|
||||
--echo # Start of 5.5 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # Bug#55912 FORMAT with locale set fails for numbers < 1000
|
||||
--echo #
|
||||
SELECT FORMAT(123.33, 2, 'no_NO'), FORMAT(1123.33, 2, 'no_NO');
|
||||
SELECT FORMAT(12333e-2, 2, 'no_NO'), FORMAT(112333e-2, 2, 'no_NO');
|
||||
CREATE TABLE t1 AS SELECT format(123,2,'no_NO');
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 5.5 tests
|
||||
--echo #
|
||||
|
40
mysql-test/t/handler_read_last.test
Normal file
40
mysql-test/t/handler_read_last.test
Normal file
@ -0,0 +1,40 @@
|
||||
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (a INT, INDEX (a));
|
||||
INSERT INTO t1 VALUES (),(),(),(),(),(),(),(),(),();
|
||||
|
||||
FLUSH STATUS;
|
||||
SELECT a FROM t1 ORDER BY a LIMIT 1;
|
||||
SHOW STATUS LIKE 'HANDLER_READ%';
|
||||
|
||||
FLUSH STATUS;
|
||||
SELECT a FROM t1 ORDER BY a DESC LIMIT 1;
|
||||
SHOW STATUS LIKE 'HANDLER_READ%';
|
||||
|
||||
FLUSH STATUS;
|
||||
SELECT a FROM t1 ORDER BY a LIMIT 3;
|
||||
SHOW STATUS LIKE 'HANDLER_READ%';
|
||||
|
||||
FLUSH STATUS;
|
||||
SELECT a FROM t1 ORDER BY a DESC LIMIT 3;
|
||||
SHOW STATUS LIKE 'HANDLER_READ%';
|
||||
|
||||
DROP TABLE t1;
|
||||
|
@ -1470,7 +1470,8 @@ connection con3726_2;
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and info like "rename table t2 to t3";
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info like "rename table t2 to t3";
|
||||
--source include/wait_condition.inc
|
||||
--echo # These statements should not be blocked by pending lock requests
|
||||
select table_name, column_name, data_type from information_schema.columns
|
||||
|
@ -89,3 +89,23 @@ from information_schema.referential_constraints
|
||||
where constraint_schema = schema();
|
||||
drop table t2;
|
||||
set foreign_key_checks = 1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#55973 Assertion `thd->transaction.stmt.is_empty()'
|
||||
--echo # on CREATE TABLE .. SELECT I_S.PART
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE VIEW v1 AS SELECT 1;
|
||||
# This used to case an assert.
|
||||
CREATE TABLE t1 engine = InnoDB AS
|
||||
SELECT * FROM information_schema.partitions
|
||||
WHERE table_schema= 'test' AND table_name= 'v1';
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP VIEW v1;
|
||||
|
@ -42,7 +42,7 @@ let $wait_condition=
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist
|
||||
WHERE info = "DROP TABLE t1" and
|
||||
state = "Waiting for table";
|
||||
state = "Waiting for table metadata lock";
|
||||
--source include/wait_condition.inc
|
||||
--echo # Connection 1 is now holding the lock.
|
||||
--echo # Issuing insert from connection 1 while connection 2&3
|
||||
@ -97,7 +97,8 @@ connection default;
|
||||
--echo # connection holds SW metadata lock on table to be altered.
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and info = "alter table t1 add column c4 int";
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "alter table t1 add column c4 int";
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--echo # The below statement should succeed. It should not
|
||||
@ -196,7 +197,7 @@ connection default;
|
||||
--echo # Connection con1
|
||||
connection con1;
|
||||
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
|
||||
WHERE state='Waiting for table' AND info='OPTIMIZE TABLE t1';
|
||||
WHERE state='Waiting for table metadata lock' AND info='OPTIMIZE TABLE t1';
|
||||
--source include/wait_condition.inc
|
||||
SELECT * FROM t1;
|
||||
COMMIT;
|
||||
@ -241,7 +242,7 @@ connection con2;
|
||||
--echo # Waiting for 'SELECT * FROM v1' to sync in.
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist
|
||||
WHERE state = "Waiting for table" AND info = "SELECT * FROM v1";
|
||||
WHERE state = "Waiting for table metadata lock" AND info = "SELECT * FROM v1";
|
||||
--source include/wait_condition.inc
|
||||
# This should block due to v1 being locked.
|
||||
--echo # Sending:
|
||||
@ -252,7 +253,8 @@ connection con3;
|
||||
--echo # Waiting for 'ALTER VIEW v1 AS SELECT 2 FROM t2' to sync in.
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist
|
||||
WHERE state = "Waiting for table" AND info = "ALTER VIEW v1 AS SELECT 2 FROM t2";
|
||||
WHERE state = "Waiting for table metadata lock" AND
|
||||
info = "ALTER VIEW v1 AS SELECT 2 FROM t2";
|
||||
--source include/wait_condition.inc
|
||||
# Unlock t1 allowing SELECT * FROM v1 to proceed.
|
||||
UNLOCK TABLES;
|
||||
|
@ -799,8 +799,9 @@ connection default;
|
||||
--echo # table as it acquires LOCK_S locks on rows of old version, which
|
||||
--echo # are compatible with locks acquired by connection 'con1'.
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist where state =
|
||||
"Waiting for table" and info = "alter table t1 add column j int";
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "alter table t1 add column j int";
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--echo # The below statement will deadlock because it will try to acquire
|
||||
@ -844,7 +845,8 @@ connection default;
|
||||
--echo # Wait until ALTER is blocked because of active SR lock.
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and info = "alter table t1 rebuild partition p0";
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "alter table t1 rebuild partition p0";
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--echo # The below statement should succeed as transaction
|
||||
|
@ -174,7 +174,7 @@ connection default;
|
||||
# we must wait till the insert opens and locks the table
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Table lock" and id = $ID;
|
||||
where state = "Waiting for table level lock" and id = $ID;
|
||||
--source include/wait_condition.inc
|
||||
connect (select,localhost,root,,);
|
||||
--echo connection: select
|
||||
|
@ -357,7 +357,8 @@ let $ID= `select connection_id()`;
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and info = "rename table t1 to t2";
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "rename table t1 to t2";
|
||||
--source include/wait_condition.inc
|
||||
--replace_result $ID ID
|
||||
eval kill query $ID;
|
||||
@ -372,7 +373,7 @@ connection ddl;
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "drop table t1";
|
||||
--source include/wait_condition.inc
|
||||
--replace_result $ID ID
|
||||
@ -388,7 +389,7 @@ connection ddl;
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "create trigger t1_bi before insert on t1 for each row set @a:=1";
|
||||
--source include/wait_condition.inc
|
||||
--replace_result $ID ID
|
||||
@ -407,7 +408,7 @@ connection ddl;
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "alter table t1 add column j int";
|
||||
--source include/wait_condition.inc
|
||||
--replace_result $ID ID
|
||||
@ -423,7 +424,7 @@ connection ddl;
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "alter table t1 rename to t2";
|
||||
--source include/wait_condition.inc
|
||||
--replace_result $ID ID
|
||||
@ -437,7 +438,7 @@ connection ddl;
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "alter table t1 disable keys";
|
||||
--source include/wait_condition.inc
|
||||
--replace_result $ID ID
|
||||
@ -452,7 +453,7 @@ connection ddl;
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "alter table t1 alter column i set default 100";
|
||||
--source include/wait_condition.inc
|
||||
--replace_result $ID ID
|
||||
@ -474,7 +475,7 @@ connection ddl;
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "alter table t2 alter column i set default 100";
|
||||
--source include/wait_condition.inc
|
||||
--replace_result $ID ID
|
||||
@ -499,7 +500,7 @@ connection ddl;
|
||||
connection dml;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "rename tables t1 to t3, t2 to t1";
|
||||
--source include/wait_condition.inc
|
||||
let $ID2= `select connection_id()`;
|
||||
@ -508,7 +509,7 @@ let $ID2= `select connection_id()`;
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "insert into t2 values (1)";
|
||||
--source include/wait_condition.inc
|
||||
--replace_result $ID2 ID2
|
||||
@ -536,7 +537,7 @@ connection ddl;
|
||||
connection dml;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Flushing tables" and
|
||||
where state = "Waiting for table flush" and
|
||||
info = "flush tables";
|
||||
--source include/wait_condition.inc
|
||||
--send select * from t1
|
||||
@ -544,7 +545,7 @@ let $wait_condition=
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and
|
||||
where state = "Waiting for table flush" and
|
||||
info = "select * from t1";
|
||||
--source include/wait_condition.inc
|
||||
--replace_result $ID2 ID2
|
||||
|
@ -32,7 +32,8 @@ connection reader;
|
||||
# Sleep a bit till the update of connection writer is in work and hangs
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Table lock" and info = "update low_priority t1 set n = 4";
|
||||
where state = "Waiting for table level lock" and
|
||||
info = "update low_priority t1 set n = 4";
|
||||
--source include/wait_condition.inc
|
||||
send
|
||||
select n from t1;
|
||||
@ -40,7 +41,8 @@ connection locker2;
|
||||
# Sleep a bit till the select of connection reader is in work and hangs
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Table lock" and info = "select n from t1";
|
||||
where state = "Waiting for table level lock" and
|
||||
info = "select n from t1";
|
||||
--source include/wait_condition.inc
|
||||
select release_lock("mysqltest_lock");
|
||||
connection locker;
|
||||
@ -72,7 +74,8 @@ connection reader;
|
||||
# Sleep a bit till the update of connection writer is in work and hangs
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Table lock" and info = "update low_priority t1 set n = 4";
|
||||
where state = "Waiting for table level lock" and
|
||||
info = "update low_priority t1 set n = 4";
|
||||
--source include/wait_condition.inc
|
||||
select n from t1;
|
||||
connection locker2;
|
||||
@ -120,7 +123,8 @@ insert t1 select * from t2;
|
||||
connection locker;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and info = "insert t1 select * from t2";
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "insert t1 select * from t2";
|
||||
--source include/wait_condition.inc
|
||||
drop table t2;
|
||||
unlock tables;
|
||||
@ -145,7 +149,8 @@ connection locker;
|
||||
# Sleep a bit till the insert of connection reader is in work and hangs
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and info = "insert t1 select * from t2";
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "insert t1 select * from t2";
|
||||
--source include/wait_condition.inc
|
||||
drop table t2;
|
||||
unlock tables;
|
||||
@ -191,7 +196,7 @@ connection locker;
|
||||
# Sleep a bit till the select of connection reader is in work and hangs
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist
|
||||
WHERE state = "Waiting for table" AND info =
|
||||
WHERE state = "Waiting for table metadata lock" AND info =
|
||||
"SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1";
|
||||
--source include/wait_condition.inc
|
||||
# Make test case independent from earlier grants.
|
||||
@ -223,7 +228,8 @@ connection writer;
|
||||
# Sleep a bit till the flush of connection locker is in work and hangs
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and info = "FLUSH TABLES WITH READ LOCK";
|
||||
where state = "Waiting for global metadata lock" and
|
||||
info = "FLUSH TABLES WITH READ LOCK";
|
||||
--source include/wait_condition.inc
|
||||
# This must not block.
|
||||
--error ER_TABLE_NOT_LOCKED
|
||||
@ -254,7 +260,8 @@ connection writer;
|
||||
# Sleep a bit till the flush of connection locker is in work and hangs
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and info = "FLUSH TABLES WITH READ LOCK";
|
||||
where state = "Waiting for global metadata lock" and
|
||||
info = "FLUSH TABLES WITH READ LOCK";
|
||||
--source include/wait_condition.inc
|
||||
--error ER_TABLE_NOT_LOCKED
|
||||
CREATE TABLE t2 AS SELECT * FROM t1;
|
||||
@ -326,7 +333,8 @@ connection reader;
|
||||
# Wait till connection writer is blocked
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and info = "alter table t1 auto_increment=0";
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "alter table t1 auto_increment=0";
|
||||
--source include/wait_condition.inc
|
||||
send
|
||||
alter table t1 auto_increment=0;
|
||||
@ -334,7 +342,8 @@ connection locker;
|
||||
# Wait till connection reader is blocked
|
||||
let $wait_condition=
|
||||
select count(*) = 2 from information_schema.processlist
|
||||
where state = "Waiting for table" and info = "alter table t1 auto_increment=0";
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "alter table t1 auto_increment=0";
|
||||
--source include/wait_condition.inc
|
||||
unlock tables;
|
||||
connection writer;
|
||||
@ -367,7 +376,8 @@ connection con5;
|
||||
--echo # con5
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and info = "flush tables with read lock";
|
||||
where state = "Waiting for global metadata lock" and
|
||||
info = "flush tables with read lock";
|
||||
--source include/wait_condition.inc
|
||||
--echo # global read lock is taken
|
||||
connection con3;
|
||||
@ -489,16 +499,20 @@ update t1 set i= 10;
|
||||
connection reader;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Table lock" and info = "update t1 set i= 10";
|
||||
where state = "Waiting for table level lock" and
|
||||
info = "update t1 set i= 10";
|
||||
--source include/wait_condition.inc
|
||||
send
|
||||
select * from t1;
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Table lock" and info = "select * from t1";
|
||||
where state = "Waiting for table level lock" and
|
||||
info = "select * from t1";
|
||||
--source include/wait_condition.inc
|
||||
let $ID= `select id from information_schema.processlist where state = "Table lock" and info = "update t1 set i= 10"`;
|
||||
let $ID= `select id from information_schema.processlist
|
||||
where state = "Waiting for table level lock" and
|
||||
info = "update t1 set i= 10"`;
|
||||
--replace_result $ID ID
|
||||
eval kill query $ID;
|
||||
connection reader;
|
||||
@ -557,7 +571,7 @@ connection default;
|
||||
--echo connection: default
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table";
|
||||
where state = "Waiting for global metadata lock";
|
||||
--source include/wait_condition.inc
|
||||
alter table t1 add column j int;
|
||||
connect (insert,localhost,root,,test,,);
|
||||
@ -565,7 +579,7 @@ connection insert;
|
||||
--echo connection: insert
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table";
|
||||
where state = "Waiting for global metadata lock";
|
||||
--source include/wait_condition.inc
|
||||
--send insert into t1 values (1,2);
|
||||
--echo connection: default
|
||||
@ -615,12 +629,12 @@ connection default;
|
||||
--echo connection: default
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table";
|
||||
where state = "Waiting for global metadata lock";
|
||||
--source include/wait_condition.inc
|
||||
flush tables;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table";
|
||||
where state = "Waiting for global metadata lock";
|
||||
--source include/wait_condition.inc
|
||||
unlock tables;
|
||||
connection flush;
|
||||
@ -646,7 +660,8 @@ send insert into t1 values(1);
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Table lock" and info = "insert into t1 values(1)";
|
||||
where state = "Waiting for table level lock" and
|
||||
info = "insert into t1 values(1)";
|
||||
--source include/wait_condition.inc
|
||||
let $tlwb= `show status like 'Table_locks_waited'`;
|
||||
unlock tables;
|
||||
@ -683,12 +698,12 @@ connection default;
|
||||
--echo connection: default
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table";
|
||||
where state = "Waiting for global metadata lock";
|
||||
--source include/wait_condition.inc
|
||||
flush tables;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table";
|
||||
where state = "Waiting for global metadata lock";
|
||||
--source include/wait_condition.inc
|
||||
drop table t1;
|
||||
connection flush;
|
||||
@ -725,7 +740,8 @@ connection default;
|
||||
--echo # connection holds SW metadata lock on table to be altered.
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and info = "alter table t1 add column c4 int";
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "alter table t1 add column c4 int";
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--echo # The below statement should succeed. It should not
|
||||
@ -825,7 +841,8 @@ connection default;
|
||||
--echo # Wait until ALTER TABLE gets blocked.
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and info = "alter table t1 add column j int";
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "alter table t1 add column j int";
|
||||
--source include/wait_condition.inc
|
||||
--echo # The below statement should try to acquire SW lock on 't1'
|
||||
--echo # and therefore should get ER_LOCK_DEADLOCK error. Before
|
||||
@ -855,7 +872,8 @@ connection default;
|
||||
--echo # Wait until ALTER TABLE gets blocked.
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and info = "alter table t1 drop column j";
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "alter table t1 drop column j";
|
||||
--source include/wait_condition.inc
|
||||
--echo # The below statement should try to acquire SW lock on 't1'
|
||||
--echo # and therefore should get ER_LOCK_DEADLOCK error. Before
|
||||
@ -982,7 +1000,7 @@ connection con3;
|
||||
connection con2;
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist
|
||||
WHERE state = "Flushing tables" AND info = "FLUSH TABLES";
|
||||
WHERE state = "Waiting for table flush" AND info = "FLUSH TABLES";
|
||||
--source include/wait_condition.inc
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
SELECT * FROM t1;
|
||||
@ -1014,7 +1032,8 @@ connection con3;
|
||||
connection con2;
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist
|
||||
WHERE state = "Waiting for table" AND info = "DROP TABLE t1, t2";
|
||||
WHERE state = "Waiting for table metadata lock" AND
|
||||
info = "DROP TABLE t1, t2";
|
||||
--source include/wait_condition.inc
|
||||
# Note: This query causes two timeouts.
|
||||
# 1: try_acquire_high_prio_shared_mdl_lock on t1
|
||||
@ -1069,7 +1088,8 @@ connection default;
|
||||
--echo # Wait until RENAME TABLE is blocked on table 't3'.
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table" and info = "rename tables t1 to t2, t2 to t3";
|
||||
where state = "Waiting for table metadata lock" and
|
||||
info = "rename tables t1 to t2, t2 to t3";
|
||||
--source include/wait_condition.inc
|
||||
--echo # Kill RENAME TABLE.
|
||||
--replace_result $ID ID
|
||||
|
@ -898,7 +898,7 @@ set debug_sync= 'now WAIT_FOR parked';
|
||||
connection default;
|
||||
--echo # Wait until this LOCK TABLES statement starts waiting for table lock.
|
||||
let $wait_condition= select count(*)= 1 from information_schema.processlist
|
||||
where state= 'Table lock' and
|
||||
where state= 'Waiting for table level lock' and
|
||||
info='lock table v1 write';
|
||||
--source include/wait_condition.inc
|
||||
--echo # Allow SELECT ... FOR UPDATE to resume.
|
||||
@ -972,7 +972,7 @@ connection default;
|
||||
connection con2;
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist
|
||||
WHERE state = "Waiting for table"
|
||||
WHERE state = "Waiting for table metadata lock"
|
||||
AND info = "ALTER TABLE t1 ADD COLUMN j INT";
|
||||
--source include/wait_condition.inc
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -51,7 +51,7 @@ connection default;
|
||||
#--sleep 8
|
||||
#SELECT ID,STATE,INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
|
||||
let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
|
||||
WHERE ID = $con1_id AND STATE = 'Waiting for table';
|
||||
WHERE ID = $con1_id AND STATE = 'Waiting for table metadata lock';
|
||||
--source include/wait_condition.inc
|
||||
#SELECT NOW();
|
||||
--echo # Kick INSERT out of thr_multi_lock().
|
||||
@ -61,7 +61,7 @@ FLUSH TABLES;
|
||||
#--sleep 8
|
||||
#SELECT ID,STATE,INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
|
||||
let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
|
||||
WHERE ID = $con1_id AND STATE = 'Waiting for table';
|
||||
WHERE ID = $con1_id AND STATE = 'Waiting for table metadata lock';
|
||||
--source include/wait_condition.inc
|
||||
#SELECT NOW();
|
||||
--echo # Unlock and close table and wait for con1 to close too.
|
||||
|
@ -579,7 +579,7 @@ DROP TABLE tm1, t1, t2;
|
||||
#
|
||||
CREATE TABLE t1(c1 INT);
|
||||
CREATE TABLE t2 (c1 INT) ENGINE=MERGE UNION=(t1) INSERT_METHOD=FIRST;
|
||||
--error ER_UPDATE_TABLE_USED
|
||||
# After WL#5370, it just generates a warning that the table already exists
|
||||
CREATE TABLE IF NOT EXISTS t1 SELECT * FROM t2;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
|
@ -497,7 +497,7 @@ connection updater;
|
||||
# Wait till "alter table t1 ..." of session changer is in work.
|
||||
# = There is one session waiting.
|
||||
let $wait_condition= select count(*)= 1 from information_schema.processlist
|
||||
where state= 'Waiting for table';
|
||||
where state= 'Waiting for table metadata lock';
|
||||
--source include/wait_condition.inc
|
||||
send update t1, v1 set t1.b=t1.a+t1.b+v1.b where t1.a=v1.a;
|
||||
|
||||
@ -508,7 +508,7 @@ connection locker;
|
||||
# are in work.
|
||||
# = There are two session waiting.
|
||||
let $wait_condition= select count(*)= 2 from information_schema.processlist
|
||||
where state= 'Waiting for table';
|
||||
where state= 'Waiting for table metadata lock';
|
||||
--source include/wait_condition.inc
|
||||
unlock tables;
|
||||
|
||||
|
15
mysql-test/t/mysql_not_windows.test
Normal file
15
mysql-test/t/mysql_not_windows.test
Normal file
@ -0,0 +1,15 @@
|
||||
-- source include/not_windows.inc
|
||||
# This test should work in embedded server after we fix mysqltest
|
||||
-- source include/not_embedded.inc
|
||||
#
|
||||
# Testing the MySQL command line client(mysql)
|
||||
#
|
||||
|
||||
#
|
||||
# Bug #54466 client 5.5 built from source lacks "pager" support
|
||||
#
|
||||
--echo Bug #54466 client 5.5 built from source lacks "pager" support
|
||||
--exec $MYSQL --pager test -e "select 1 as a"
|
||||
|
||||
--echo
|
||||
--echo End of tests
|
@ -27,6 +27,7 @@ ALTER TABLE t1 CHECK PARTITION ALL;
|
||||
ALTER TABLE t1 OPTIMIZE PARTITION ALL;
|
||||
ALTER TABLE t1 ANALYZE PARTITION ALL;
|
||||
ALTER TABLE t1 REBUILD PARTITION ALL;
|
||||
ALTER TABLE t1 TRUNCATE PARTITION ALL;
|
||||
ALTER TABLE t1 ENGINE Memory;
|
||||
ALTER TABLE t1 ADD (new INT);
|
||||
DROP TABLE t1;
|
||||
|
@ -8,6 +8,107 @@ drop table if exists t1, t2;
|
||||
|
||||
let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#54747: Deadlock between REORGANIZE PARTITION and
|
||||
--echo # SELECT is not detected
|
||||
--echo #
|
||||
|
||||
SET @old_innodb_thread_concurrency:= @@innodb_thread_concurrency;
|
||||
SET GLOBAL innodb_thread_concurrency = 1;
|
||||
|
||||
CREATE TABLE t1
|
||||
(user_num BIGINT,
|
||||
hours SMALLINT,
|
||||
KEY user_num (user_num))
|
||||
ENGINE = InnoDB
|
||||
PARTITION BY RANGE COLUMNS (hours)
|
||||
(PARTITION hour_003 VALUES LESS THAN (3),
|
||||
PARTITION hour_004 VALUES LESS THAN (4),
|
||||
PARTITION hour_005 VALUES LESS THAN (5),
|
||||
PARTITION hour_last VALUES LESS THAN (MAXVALUE));
|
||||
|
||||
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
|
||||
|
||||
BEGIN;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
|
||||
--echo # con1
|
||||
--connect (con1,localhost,root,,)
|
||||
--echo # SEND a ALTER PARTITION which waits on the ongoing transaction.
|
||||
--send
|
||||
ALTER TABLE t1
|
||||
REORGANIZE PARTITION hour_003, hour_004 INTO
|
||||
(PARTITION oldest VALUES LESS THAN (4));
|
||||
|
||||
--echo # Connection default wait until the ALTER is in 'waiting for table...'
|
||||
--echo # state and then continue the transaction by trying a SELECT
|
||||
--connection default
|
||||
let $wait_condition =
|
||||
SELECT COUNT(*) = 1
|
||||
FROM information_schema.processlist
|
||||
WHERE INFO like 'ALTER TABLE t1%REORGANIZE PARTITION hour_003, hour_004%'
|
||||
AND STATE = 'Waiting for table metadata lock';
|
||||
--source include/wait_condition.inc
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COMMIT;
|
||||
|
||||
--echo # con1, reaping ALTER.
|
||||
--connection con1
|
||||
--reap
|
||||
|
||||
--echo # Disconnecting con1 and switching to default. Cleaning up.
|
||||
--disconnect con1
|
||||
|
||||
--connection default
|
||||
|
||||
SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#50418: DROP PARTITION does not interact with transactions
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
id INT AUTO_INCREMENT NOT NULL,
|
||||
name CHAR(50) NOT NULL,
|
||||
myDate DATE NOT NULL,
|
||||
PRIMARY KEY (id, myDate),
|
||||
INDEX idx_date (myDate)
|
||||
) ENGINE=InnoDB
|
||||
PARTITION BY RANGE ( TO_DAYS(myDate) ) (
|
||||
PARTITION p0 VALUES LESS THAN (734028),
|
||||
PARTITION p1 VALUES LESS THAN (734029),
|
||||
PARTITION p2 VALUES LESS THAN (734030),
|
||||
PARTITION p3 VALUES LESS THAN MAXVALUE
|
||||
) ;
|
||||
INSERT INTO t1 VALUES
|
||||
(NULL, 'Lachlan', '2009-09-13'),
|
||||
(NULL, 'Clint', '2009-09-13'),
|
||||
(NULL, 'John', '2009-09-14'),
|
||||
(NULL, 'Dave', '2009-09-14'),
|
||||
(NULL, 'Jeremy', '2009-09-15'),
|
||||
(NULL, 'Scott', '2009-09-15'),
|
||||
(NULL, 'Jeff', '2009-09-16'),
|
||||
(NULL, 'Joe', '2009-09-16');
|
||||
SET AUTOCOMMIT=0;
|
||||
SELECT * FROM t1 FOR UPDATE;
|
||||
UPDATE t1 SET name = 'Mattias' WHERE id = 7;
|
||||
SELECT * FROM t1 WHERE id = 7;
|
||||
--connect (con1, localhost, root,,)
|
||||
--echo # Connection con1
|
||||
SET lock_wait_timeout = 1;
|
||||
--echo # After the patch it will wait and fail on timeout.
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
ALTER TABLE t1 DROP PARTITION p3;
|
||||
SHOW WARNINGS;
|
||||
--disconnect con1
|
||||
--connection default
|
||||
--echo # Connection default
|
||||
SELECT * FROM t1;
|
||||
--echo # No changes.
|
||||
COMMIT;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#51830: Incorrect partition pruning on range partition (regression)
|
||||
--echo #
|
||||
|
@ -16,6 +16,7 @@ let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
--copy_file std_data/parts/t1_blackhole.frm $MYSQLD_DATADIR/test/t1.frm
|
||||
--copy_file std_data/parts/t1_blackhole.par $MYSQLD_DATADIR/test/t1.par
|
||||
SHOW TABLES;
|
||||
--replace_result $MYSQLD_DATADIR ./
|
||||
--error ER_NOT_FORM_FILE
|
||||
SHOW CREATE TABLE t1;
|
||||
--error ER_BAD_TABLE_ERROR
|
||||
|
@ -24,3 +24,10 @@ subpartitions 1
|
||||
--error ER_WRONG_PARTITION_NAME
|
||||
alter table t1 truncate partition sp1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1), (3), (8);
|
||||
--error ER_PARTITION_MGMT_ON_NONPARTITIONED
|
||||
alter table t1 truncate partition p0;
|
||||
select count(*) from t1;
|
||||
drop table t1;
|
||||
|
@ -498,12 +498,20 @@ drop table t1,t2,t3,t4;
|
||||
set query_cache_wlock_invalidate=1;
|
||||
create table t1 (a int not null);
|
||||
create table t2 (a int not null);
|
||||
create view v1 as select * from t1;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
lock table t1 write, t2 read;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
unlock table;
|
||||
select * from t1;
|
||||
# Implicit locking of t1 does not invalidate QC
|
||||
show status like "Qcache_queries_in_cache";
|
||||
lock table v1 write;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
unlock table;
|
||||
drop view v1;
|
||||
drop table t1,t2;
|
||||
set query_cache_wlock_invalidate=default;
|
||||
|
||||
|
@ -58,18 +58,18 @@ connection user3;
|
||||
# Typical information_schema.processlist content after sufficient sleep time
|
||||
# ID USER COMMAND TIME STATE INFO
|
||||
# ....
|
||||
# 2 root Query 5 Table lock SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
|
||||
# 2 root Query 5 Waiting for table level lock SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
|
||||
# ....
|
||||
# XXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
# The values marked with 'X' must be reached.
|
||||
--echo # Poll till the select of connection user1 is blocked by the write lock on t1.
|
||||
let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist
|
||||
WHERE state = 'Table lock'
|
||||
WHERE state = 'Waiting for table level lock'
|
||||
AND info = '$select_for_qc';
|
||||
--source include/wait_condition.inc
|
||||
eval
|
||||
SELECT user,command,state,info FROM information_schema.processlist
|
||||
WHERE state = 'Table lock'
|
||||
WHERE state = 'Waiting for table level lock'
|
||||
AND info = '$select_for_qc';
|
||||
INSERT INTO t1 VALUES (4);
|
||||
|
||||
|
@ -1313,4 +1313,16 @@ SELECT * FROM t1 FORCE INDEX (PRIMARY)
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #54802: 'NOT BETWEEN' evaluation is incorrect
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (c_key INT, c_notkey INT, KEY(c_key));
|
||||
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3);
|
||||
|
||||
EXPLAIN SELECT * FROM t1 WHERE 2 NOT BETWEEN c_notkey AND c_key;
|
||||
SELECT * FROM t1 WHERE 2 NOT BETWEEN c_notkey AND c_key;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -23,7 +23,6 @@ drop schema foo;
|
||||
|
||||
--disable_warnings
|
||||
DROP SCHEMA IF EXISTS schema1;
|
||||
DROP SCHEMA IF EXISTS schema2;
|
||||
--enable_warnings
|
||||
|
||||
connect(con2, localhost, root);
|
||||
@ -32,7 +31,6 @@ connect(con2, localhost, root);
|
||||
connection default;
|
||||
|
||||
CREATE SCHEMA schema1;
|
||||
CREATE SCHEMA schema2;
|
||||
CREATE TABLE schema1.t1 (a INT);
|
||||
|
||||
SET autocommit= FALSE;
|
||||
@ -45,10 +43,13 @@ connection con2;
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
|
||||
WHERE state= 'Waiting for table'
|
||||
WHERE state= 'Waiting for table metadata lock'
|
||||
AND info='DROP SCHEMA schema1';
|
||||
--source include/wait_condition.inc
|
||||
ALTER SCHEMA schema2 DEFAULT CHARACTER SET utf8;
|
||||
# Error 1 is from ALTER DATABASE when the database does not exist.
|
||||
# Listing the error twice to prevent result diffences based on filename.
|
||||
--error 1,1
|
||||
ALTER SCHEMA schema1 DEFAULT CHARACTER SET utf8;
|
||||
SET autocommit= TRUE;
|
||||
|
||||
--echo # Connection 2
|
||||
@ -57,7 +58,6 @@ connection con2;
|
||||
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
DROP SCHEMA schema2;
|
||||
disconnect con2;
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ connection con2;
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
|
||||
WHERE state='Waiting for table' and info='DROP SCHEMA schema1';
|
||||
WHERE state='Waiting for schema metadata lock' and info='DROP SCHEMA schema1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--echo # CREATE SCHEMA used to give a deadlock.
|
||||
@ -124,7 +124,7 @@ connection default;
|
||||
--echo # Connection con2
|
||||
connect (con2, localhost, root);
|
||||
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
|
||||
WHERE state='Waiting for table' AND info='DROP DATABASE db1';
|
||||
WHERE state='Waiting for table metadata lock' AND info='DROP DATABASE db1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--echo # Connection con1
|
||||
@ -172,7 +172,7 @@ connection con2;
|
||||
--echo # Connection 3
|
||||
connection con3;
|
||||
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
|
||||
WHERE state='Waiting for table' and info='DROP DATABASE db1';
|
||||
WHERE state='Waiting for table metadata lock' and info='DROP DATABASE db1';
|
||||
--source include/wait_condition.inc
|
||||
--echo # But it should still be possible to CREATE/ALTER/DROP other databases.
|
||||
CREATE DATABASE db2;
|
||||
|
@ -183,18 +183,19 @@ connection con1;
|
||||
send drop procedure p1;
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo # Waitng for 'drop procedure t1' to get blocked on MDL lock...
|
||||
--echo # Waiting for 'drop procedure t1' to get blocked on MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='drop procedure p1';
|
||||
where state='Waiting for stored procedure metadata lock' and
|
||||
info='drop procedure p1';
|
||||
--source include/wait_condition.inc
|
||||
--echo # Demonstrate that there is a pending exclusive lock.
|
||||
--echo # Sending 'select f1()'...
|
||||
send select f1();
|
||||
--echo # --> connection con3
|
||||
connection con3;
|
||||
--echo # Waitng for 'select f1()' to get blocked by a pending MDL lock...
|
||||
--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='select f1()';
|
||||
where state='Waiting for stored procedure metadata lock' and info='select f1()';
|
||||
--echo # --> connection default
|
||||
connection default;
|
||||
commit;
|
||||
@ -222,18 +223,19 @@ connection con1;
|
||||
send create procedure p1() begin end;
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo # Waitng for 'create procedure t1' to get blocked on MDL lock...
|
||||
--echo # Waiting for 'create procedure t1' to get blocked on MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='create procedure p1() begin end';
|
||||
where state='Waiting for stored procedure metadata lock' and
|
||||
info='create procedure p1() begin end';
|
||||
--source include/wait_condition.inc
|
||||
--echo # Demonstrate that there is a pending exclusive lock.
|
||||
--echo # Sending 'select f1()'...
|
||||
send select f1();
|
||||
--echo # --> connection con3
|
||||
connection con3;
|
||||
--echo # Waitng for 'select f1()' to get blocked by a pending MDL lock...
|
||||
--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='select f1()';
|
||||
where state='Waiting for stored procedure metadata lock' and info='select f1()';
|
||||
--echo # --> connection default
|
||||
connection default;
|
||||
commit;
|
||||
@ -259,18 +261,19 @@ connection con1;
|
||||
send alter procedure p1 contains sql;
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo # Waitng for 'alter procedure t1' to get blocked on MDL lock...
|
||||
--echo # Waiting for 'alter procedure t1' to get blocked on MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='alter procedure p1 contains sql';
|
||||
where state='Waiting for stored procedure metadata lock' and
|
||||
info='alter procedure p1 contains sql';
|
||||
--source include/wait_condition.inc
|
||||
--echo # Demonstrate that there is a pending exclusive lock.
|
||||
--echo # Sending 'select f1()'...
|
||||
send select f1();
|
||||
--echo # --> connection con3
|
||||
connection con3;
|
||||
--echo # Waitng for 'select f1()' to get blocked by a pending MDL lock...
|
||||
--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='select f1()';
|
||||
where state='Waiting for stored procedure metadata lock' and info='select f1()';
|
||||
--echo # --> connection default
|
||||
connection default;
|
||||
commit;
|
||||
@ -296,18 +299,19 @@ connection con1;
|
||||
send drop function f1;
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo # Waitng for 'drop function f1' to get blocked on MDL lock...
|
||||
--echo # Waiting for 'drop function f1' to get blocked on MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='drop function f1';
|
||||
where state='Waiting for stored function metadata lock' and
|
||||
info='drop function f1';
|
||||
--source include/wait_condition.inc
|
||||
--echo # Demonstrate that there is a pending exclusive lock.
|
||||
--echo # Sending 'select f1()'...
|
||||
send select f1();
|
||||
--echo # --> connection con3
|
||||
connection con3;
|
||||
--echo # Waitng for 'select f1()' to get blocked by a pending MDL lock...
|
||||
--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='select f1()';
|
||||
where state='Waiting for stored function metadata lock' and info='select f1()';
|
||||
--echo # --> connection default
|
||||
connection default;
|
||||
commit;
|
||||
@ -335,18 +339,19 @@ connection con1;
|
||||
send create function f1() returns int return 2;
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo # Waitng for 'create function f1' to get blocked on MDL lock...
|
||||
--echo # Waiting for 'create function f1' to get blocked on MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='create function f1() returns int return 2';
|
||||
where state='Waiting for stored function metadata lock' and
|
||||
info='create function f1() returns int return 2';
|
||||
--source include/wait_condition.inc
|
||||
--echo # Demonstrate that there is a pending exclusive lock.
|
||||
--echo # Sending 'select f1()'...
|
||||
send select f1();
|
||||
--echo # --> connection con3
|
||||
connection con3;
|
||||
--echo # Waitng for 'select f1()' to get blocked by a pending MDL lock...
|
||||
--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='select f1()';
|
||||
where state='Waiting for stored function metadata lock' and info='select f1()';
|
||||
--echo # --> connection default
|
||||
connection default;
|
||||
commit;
|
||||
@ -373,18 +378,19 @@ connection con1;
|
||||
send alter function f1 contains sql;
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo # Waitng for 'alter function f1' to get blocked on MDL lock...
|
||||
--echo # Waiting for 'alter function f1' to get blocked on MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='alter function f1 contains sql';
|
||||
where state='Waiting for stored function metadata lock' and
|
||||
info='alter function f1 contains sql';
|
||||
--source include/wait_condition.inc
|
||||
--echo # Demonstrate that there is a pending exclusive lock.
|
||||
--echo # Sending 'select f1()'...
|
||||
send select f1();
|
||||
--echo # --> connection con3
|
||||
connection con3;
|
||||
--echo # Waitng for 'select f1()' to get blocked by a pending MDL lock...
|
||||
--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='select f1()';
|
||||
where state='Waiting for stored function metadata lock' and info='select f1()';
|
||||
--echo # --> connection default
|
||||
connection default;
|
||||
commit;
|
||||
@ -471,9 +477,10 @@ connection con1;
|
||||
send drop function f1;
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo # Waitng for 'drop function f1' to get blocked on MDL lock...
|
||||
--echo # Waiting for 'drop function f1' to get blocked on MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='drop function f1';
|
||||
where state='Waiting for stored function metadata lock' and
|
||||
info='drop function f1';
|
||||
--source include/wait_condition.inc
|
||||
--echo # --> connnection default
|
||||
connection default;
|
||||
@ -497,9 +504,10 @@ connection con1;
|
||||
send drop function f1;
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo # Waitng for 'drop function f1' to get blocked on MDL lock...
|
||||
--echo # Waiting for 'drop function f1' to get blocked on MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='drop function f1';
|
||||
where state='Waiting for stored function metadata lock' and
|
||||
info='drop function f1';
|
||||
--source include/wait_condition.inc
|
||||
--echo # --> connnection default
|
||||
connection default;
|
||||
@ -530,9 +538,10 @@ connection con1;
|
||||
send drop procedure p1;
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo # Waitng for 'drop procedure p1' to get blocked on MDL lock...
|
||||
--echo # Waiting for 'drop procedure p1' to get blocked on MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='drop procedure p1';
|
||||
where state='Waiting for stored procedure metadata lock' and
|
||||
info='drop procedure p1';
|
||||
--source include/wait_condition.inc
|
||||
--echo # --> connnection default
|
||||
connection default;
|
||||
@ -561,9 +570,10 @@ connection con1;
|
||||
send drop function f2;
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo # Waitng for 'drop function f2' to get blocked on MDL lock...
|
||||
--echo # Waiting for 'drop function f2' to get blocked on MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='drop function f2';
|
||||
where state='Waiting for stored function metadata lock' and
|
||||
info='drop function f2';
|
||||
--source include/wait_condition.inc
|
||||
--echo # --> connnection default
|
||||
connection default;
|
||||
@ -623,17 +633,19 @@ connection con1;
|
||||
send drop function f1;
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo # Waitng for 'drop function f1' to get blocked on MDL lock...
|
||||
--echo # Waiting for 'drop function f1' to get blocked on MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='drop function f1';
|
||||
where state='Waiting for stored function metadata lock' and
|
||||
info='drop function f1';
|
||||
--source include/wait_condition.inc
|
||||
--echo # Sending 'drop function f2'...
|
||||
send drop function f2;
|
||||
--echo # --> connection default
|
||||
connection default;
|
||||
--echo # Waitng for 'drop function f2' to get blocked on MDL lock...
|
||||
--echo # Waiting for 'drop function f2' to get blocked on MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='drop function f2';
|
||||
where state='Waiting for stored function metadata lock' and
|
||||
info='drop function f2';
|
||||
--source include/wait_condition.inc
|
||||
rollback to savepoint sv;
|
||||
--echo # --> connection con2
|
||||
@ -699,16 +711,18 @@ connection con1;
|
||||
send alter function f1 comment "comment";
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo # Waitng for 'alter function f1 ...' to get blocked on MDL lock...
|
||||
--echo # Waiting for 'alter function f1 ...' to get blocked on MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info like 'alter function f1 comment%';
|
||||
where state='Waiting for stored function metadata lock' and
|
||||
info like 'alter function f1 comment%';
|
||||
--source include/wait_condition.inc
|
||||
--echo # Sending 'call p1()'...
|
||||
send call p1();
|
||||
connection default;
|
||||
--echo # Waitng for 'call p1()' to get blocked on MDL lock on f1...
|
||||
--echo # Waiting for 'call p1()' to get blocked on MDL lock on f1...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='select f1() into @var';
|
||||
where state='Waiting for stored function metadata lock' and
|
||||
info='select f1() into @var';
|
||||
--source include/wait_condition.inc
|
||||
--echo # Let 'alter function f1 ...' go through...
|
||||
commit;
|
||||
@ -746,9 +760,10 @@ connection con1;
|
||||
send alter function f1 comment "comment";
|
||||
--echo # --> connection con2
|
||||
connection con2;
|
||||
--echo # Waitng for 'alter function f1 ...' to get blocked on MDL lock...
|
||||
--echo # Waiting for 'alter function f1 ...' to get blocked on MDL lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info like 'alter function f1 comment%';
|
||||
where state='Waiting for stored function metadata lock' and
|
||||
info like 'alter function f1 comment%';
|
||||
--source include/wait_condition.inc
|
||||
delimiter |;
|
||||
--echo #
|
||||
@ -774,9 +789,10 @@ delimiter ;|
|
||||
--echo # Sending 'call p1()'...
|
||||
send call p1();
|
||||
connection default;
|
||||
--echo # Waitng for 'call p1()' to get blocked on MDL lock on f1...
|
||||
--echo # Waiting for 'call p1()' to get blocked on MDL lock on f1...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='Waiting for table' and info='select f1() into @var';
|
||||
where state='Waiting for stored function metadata lock' and
|
||||
info='select f1() into @var';
|
||||
--source include/wait_condition.inc
|
||||
--echo # Let 'alter function f1 ...' go through...
|
||||
commit;
|
||||
@ -825,7 +841,7 @@ connection default;
|
||||
send select f3();
|
||||
--echo # --> connection con1
|
||||
connection con1;
|
||||
--echo # Waitng for 'select f3()' to get blocked on the user level lock...
|
||||
--echo # Waiting for 'select f3()' to get blocked on the user level lock...
|
||||
let $wait_condition=select count(*)=1 from information_schema.processlist
|
||||
where state='User lock' and info='select f1() into @var';
|
||||
--source include/wait_condition.inc
|
||||
|
@ -322,7 +322,7 @@ set session low_priority_updates=on;
|
||||
connection rl_wait;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Table lock" and
|
||||
where state = "Waiting for table level lock" and
|
||||
info = "update t1 set value='updated' where value='old'";
|
||||
--source include/wait_condition.inc
|
||||
|
||||
|
@ -87,7 +87,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR locked';
|
||||
--echo # Connection con3
|
||||
connection con3;
|
||||
let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
|
||||
WHERE state= 'Waiting for table'
|
||||
WHERE state= 'Waiting for stored function metadata lock'
|
||||
AND info='SHOW OPEN TABLES WHERE f1()=0';
|
||||
--source include/wait_condition.inc
|
||||
--echo # Check that the IS query is blocked before releasing the x-lock
|
||||
|
@ -58,7 +58,8 @@ let $ID= `select connection_id()`;
|
||||
connection con2;
|
||||
--echo # Switched to connection: con2
|
||||
# wait for the other query to start executing
|
||||
let $wait_condition= select 1 from INFORMATION_SCHEMA.PROCESSLIST where ID = $ID and STATE = "Table lock";
|
||||
let $wait_condition= select 1 from INFORMATION_SCHEMA.PROCESSLIST
|
||||
where ID = $ID and STATE = "Waiting for table level lock";
|
||||
--source include/wait_condition.inc
|
||||
unlock tables;
|
||||
|
||||
|
@ -1751,7 +1751,7 @@ create trigger t1_ai after insert on t1 for each row set @a := 7;
|
||||
create table t2 (j int);
|
||||
insert into t2 values (1), (2);
|
||||
set @a:="";
|
||||
create table if not exists t1 select * from t2;
|
||||
insert into t1 select * from t2;
|
||||
select * from t1;
|
||||
select @a;
|
||||
# Let us check that trigger that involves table also works ok.
|
||||
@ -1759,7 +1759,7 @@ drop trigger t1_bi;
|
||||
drop trigger t1_ai;
|
||||
create table t3 (isave int);
|
||||
create trigger t1_bi before insert on t1 for each row insert into t3 values (new.i);
|
||||
create table if not exists t1 select * from t2;
|
||||
insert into t1 select * from t2;
|
||||
select * from t1;
|
||||
select * from t3;
|
||||
drop table t1, t2, t3;
|
||||
@ -1975,7 +1975,7 @@ select * from t1_op_log;
|
||||
truncate t1;
|
||||
truncate t1_op_log;
|
||||
|
||||
create table if not exists t1
|
||||
insert into t1
|
||||
select NULL, "CREATE TABLE ... SELECT, inserting a new key";
|
||||
|
||||
set @id=last_insert_id();
|
||||
@ -1984,7 +1984,7 @@ select * from t1;
|
||||
select * from t1_op_log;
|
||||
truncate t1_op_log;
|
||||
|
||||
create table if not exists t1 replace
|
||||
replace into t1
|
||||
select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key";
|
||||
|
||||
select * from t1;
|
||||
@ -2114,7 +2114,7 @@ select * from t1_op_log;
|
||||
truncate t1;
|
||||
truncate t1_op_log;
|
||||
|
||||
create table if not exists v1
|
||||
insert into v1
|
||||
select NULL, "CREATE TABLE ... SELECT, inserting a new key";
|
||||
|
||||
set @id=last_insert_id();
|
||||
@ -2123,7 +2123,7 @@ select * from t1;
|
||||
select * from t1_op_log;
|
||||
truncate t1_op_log;
|
||||
|
||||
create table if not exists v1 replace
|
||||
replace into v1
|
||||
select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key";
|
||||
|
||||
select * from t1;
|
||||
|
@ -896,7 +896,7 @@ connection default;
|
||||
--echo connection: default
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table";
|
||||
where state = "Waiting for global metadata lock";
|
||||
--source include/wait_condition.inc
|
||||
create trigger t1_bi before insert on t1 for each row begin end;
|
||||
unlock tables;
|
||||
|
@ -253,7 +253,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a desc LIMIT 1;
|
||||
|
||||
create temporary table t1 select a from t1 union select a from t2;
|
||||
drop temporary table t1;
|
||||
--error 1093
|
||||
--error ER_TABLE_EXISTS_ERROR
|
||||
create table t1 select a from t1 union select a from t2;
|
||||
--error 1054
|
||||
select a from t1 union select a from t2 order by t2.a;
|
||||
|
@ -4074,7 +4074,8 @@ connection default;
|
||||
connection con2;
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 from information_schema.processlist
|
||||
WHERE state = "Table lock" AND info = "INSERT INTO t1 SELECT * FROM v1";
|
||||
WHERE state = "Waiting for table level lock" AND
|
||||
info = "INSERT INTO t1 SELECT * FROM v1";
|
||||
--source include/wait_condition.inc
|
||||
--echo # ... then try to drop the view. This should block.
|
||||
--echo # Sending:
|
||||
@ -4084,7 +4085,7 @@ let $wait_condition=
|
||||
connection con3;
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 from information_schema.processlist
|
||||
WHERE state = "Waiting for table" AND info = "DROP VIEW v1";
|
||||
WHERE state = "Waiting for table metadata lock" AND info = "DROP VIEW v1";
|
||||
--source include/wait_condition.inc
|
||||
--echo # Now allow CALL p1() to complete
|
||||
UNLOCK TABLES;
|
||||
|
Reference in New Issue
Block a user