mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge from mysql-5.5.14-release
This commit is contained in:
@ -1,3 +1,46 @@
|
||||
set global innodb_file_per_table=on;
|
||||
set global innodb_file_format='Barracuda';
|
||||
CREATE TABLE t1_purge (
|
||||
A INT,
|
||||
B BLOB, C BLOB, D BLOB, E BLOB,
|
||||
F BLOB, G BLOB, H BLOB,
|
||||
PRIMARY KEY (B(767), C(767), D(767), E(767), A),
|
||||
INDEX (A)
|
||||
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||
INSERT INTO t1_purge VALUES (1,
|
||||
REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
|
||||
REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
|
||||
CREATE TABLE t2_purge (
|
||||
A INT PRIMARY KEY,
|
||||
B BLOB, C BLOB, D BLOB, E BLOB,
|
||||
F BLOB, G BLOB, H BLOB, I BLOB,
|
||||
J BLOB, K BLOB, L BLOB,
|
||||
INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||
INSERT INTO t2_purge VALUES (1,
|
||||
REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
|
||||
REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
|
||||
REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
|
||||
CREATE TABLE t3_purge (
|
||||
A INT,
|
||||
B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
|
||||
F VARCHAR(800), G VARCHAR(800), H VARCHAR(800),
|
||||
PRIMARY KEY (B(767), C(767), D(767), E(767), A),
|
||||
INDEX (A)
|
||||
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||
INSERT INTO t3_purge SELECT * FROM t1_purge;
|
||||
CREATE TABLE t4_purge (
|
||||
A INT PRIMARY KEY,
|
||||
B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
|
||||
F VARCHAR(800), G VARCHAR(800), H VARCHAR(800), I VARCHAR(800),
|
||||
J VARCHAR(800), K VARCHAR(800), L VARCHAR(800),
|
||||
INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||
INSERT INTO t4_purge SELECT * FROM t2_purge;
|
||||
DELETE FROM t1_purge;
|
||||
DELETE FROM t2_purge;
|
||||
DELETE FROM t3_purge;
|
||||
DELETE FROM t4_purge;
|
||||
set global innodb_file_per_table=0;
|
||||
set global innodb_file_format=Antelope;
|
||||
create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
|
||||
insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
|
||||
commit;
|
||||
@ -1098,44 +1141,7 @@ t2 CREATE TABLE `t2` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
|
||||
CREATE TABLE t2 (a INT, b CHAR(1)) ENGINE=InnoDB;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
BEGIN;
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
3 a
|
||||
3 b
|
||||
1 c
|
||||
0 d
|
||||
1 e
|
||||
SET lock_wait_timeout=1;
|
||||
CREATE INDEX t1a ON t1(a);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
CREATE INDEX t2a ON t2(a);
|
||||
SELECT * FROM t2;
|
||||
a b
|
||||
3 a
|
||||
3 b
|
||||
1 c
|
||||
0 d
|
||||
1 e
|
||||
SELECT * FROM t2 FORCE INDEX(t2a) ORDER BY a;
|
||||
ERROR HY000: Table definition has changed, please retry transaction
|
||||
SELECT * FROM t2;
|
||||
a b
|
||||
3 a
|
||||
3 b
|
||||
1 c
|
||||
0 d
|
||||
1 e
|
||||
COMMIT;
|
||||
SELECT * FROM t2 FORCE INDEX(t2a) ORDER BY a;
|
||||
a b
|
||||
0 d
|
||||
1 c
|
||||
1 e
|
||||
3 a
|
||||
3 b
|
||||
DROP TABLE t1,t2;
|
||||
SELECT SLEEP(10);
|
||||
SLEEP(10)
|
||||
0
|
||||
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
|
||||
|
@ -4,6 +4,65 @@ let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
|
||||
|
||||
let $per_table=`select @@innodb_file_per_table`;
|
||||
let $format=`select @@innodb_file_format`;
|
||||
set global innodb_file_per_table=on;
|
||||
set global innodb_file_format='Barracuda';
|
||||
|
||||
# Test an assertion failure on purge.
|
||||
CREATE TABLE t1_purge (
|
||||
A INT,
|
||||
B BLOB, C BLOB, D BLOB, E BLOB,
|
||||
F BLOB, G BLOB, H BLOB,
|
||||
PRIMARY KEY (B(767), C(767), D(767), E(767), A),
|
||||
INDEX (A)
|
||||
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||
|
||||
INSERT INTO t1_purge VALUES (1,
|
||||
REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
|
||||
REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
|
||||
|
||||
CREATE TABLE t2_purge (
|
||||
A INT PRIMARY KEY,
|
||||
B BLOB, C BLOB, D BLOB, E BLOB,
|
||||
F BLOB, G BLOB, H BLOB, I BLOB,
|
||||
J BLOB, K BLOB, L BLOB,
|
||||
INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||
|
||||
INSERT INTO t2_purge VALUES (1,
|
||||
REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
|
||||
REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
|
||||
REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
|
||||
|
||||
CREATE TABLE t3_purge (
|
||||
A INT,
|
||||
B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
|
||||
F VARCHAR(800), G VARCHAR(800), H VARCHAR(800),
|
||||
PRIMARY KEY (B(767), C(767), D(767), E(767), A),
|
||||
INDEX (A)
|
||||
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||
|
||||
INSERT INTO t3_purge SELECT * FROM t1_purge;
|
||||
|
||||
CREATE TABLE t4_purge (
|
||||
A INT PRIMARY KEY,
|
||||
B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
|
||||
F VARCHAR(800), G VARCHAR(800), H VARCHAR(800), I VARCHAR(800),
|
||||
J VARCHAR(800), K VARCHAR(800), L VARCHAR(800),
|
||||
INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||
|
||||
INSERT INTO t4_purge SELECT * FROM t2_purge;
|
||||
|
||||
# This would trigger the failure (Bug #12429576)
|
||||
# if purge gets a chance to run before DROP TABLE t1_purge, ....
|
||||
DELETE FROM t1_purge;
|
||||
DELETE FROM t2_purge;
|
||||
DELETE FROM t3_purge;
|
||||
DELETE FROM t4_purge;
|
||||
|
||||
eval set global innodb_file_per_table=$per_table;
|
||||
eval set global innodb_file_format=$format;
|
||||
|
||||
create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
|
||||
insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
|
||||
commit;
|
||||
@ -357,8 +416,6 @@ explain select * from t1 where b like 'adfd%';
|
||||
# end disabled45225_1
|
||||
drop table t1;
|
||||
|
||||
let $per_table=`select @@innodb_file_per_table`;
|
||||
let $format=`select @@innodb_file_format`;
|
||||
set global innodb_file_per_table=on;
|
||||
set global innodb_file_format='Barracuda';
|
||||
# Test creating a table that could lead to undo log overflow.
|
||||
@ -532,35 +589,37 @@ SHOW CREATE TABLE t2;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
connect (a,localhost,root,,);
|
||||
connect (b,localhost,root,,);
|
||||
connection a;
|
||||
CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
|
||||
CREATE TABLE t2 (a INT, b CHAR(1)) ENGINE=InnoDB;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
connection b;
|
||||
BEGIN;
|
||||
# This acquires a MDL lock on t1 until commit.
|
||||
SELECT * FROM t1;
|
||||
connection a;
|
||||
# This times out before of the MDL lock held by connection b.
|
||||
SET lock_wait_timeout=1;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
CREATE INDEX t1a ON t1(a);
|
||||
CREATE INDEX t2a ON t2(a);
|
||||
connection b;
|
||||
SELECT * FROM t2;
|
||||
--error ER_TABLE_DEF_CHANGED
|
||||
SELECT * FROM t2 FORCE INDEX(t2a) ORDER BY a;
|
||||
SELECT * FROM t2;
|
||||
COMMIT;
|
||||
SELECT * FROM t2 FORCE INDEX(t2a) ORDER BY a;
|
||||
connection default;
|
||||
disconnect a;
|
||||
disconnect b;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
# The following tests are disabled because of the introduced timeouts for
|
||||
# metadata locks at the MySQL level as part of the fix for
|
||||
# Bug#45225 Locking: hang if drop table with no timeout
|
||||
# The following CREATE INDEX t1a ON t1(a); causes a lock wait timeout
|
||||
# start disabled45225_2
|
||||
#connect (a,localhost,root,,);
|
||||
#connect (b,localhost,root,,);
|
||||
#connection a;
|
||||
#CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
|
||||
#INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
|
||||
#connection b;
|
||||
#BEGIN;
|
||||
#SELECT * FROM t1;
|
||||
#connection a;
|
||||
#CREATE INDEX t1a ON t1(a);
|
||||
#connection b;
|
||||
#SELECT * FROM t1;
|
||||
#--error ER_TABLE_DEF_CHANGED
|
||||
#SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
|
||||
#SELECT * FROM t1;
|
||||
#COMMIT;
|
||||
#SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
|
||||
#connection default;
|
||||
#disconnect a;
|
||||
#disconnect b;
|
||||
#
|
||||
#DROP TABLE t1;
|
||||
# end disabled45225_2
|
||||
#this delay is needed because 45225_2 is disabled, to allow the purge to run
|
||||
SELECT SLEEP(10);
|
||||
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
|
||||
|
||||
#
|
||||
# restore environment to the state it was before this test execution
|
||||
|
Reference in New Issue
Block a user