1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge the test innodb.innodb_misc1 into innodb.innodb.

This commit is contained in:
Marko Mäkelä
2016-12-13 11:52:23 +02:00
parent d26b9f670d
commit 65b4d7457e
5 changed files with 55 additions and 2166 deletions

View File

@ -1,18 +1,3 @@
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
# These files are to be modified ONLY BY INNOBASE guys. #
# #
# Use innodb_mysql.[test|result] files instead. #
# #
# If nevertheless you need to make some changes here, please, forward #
# your commit message #
# To: innodb_dev_ww@oracle.com #
# Cc: dev-innodb@mysql.com #
# (otherwise your changes may be erased). #
# #
#######################################################################
-- source include/have_innodb.inc
-- source include/have_innodb_16k.inc
@ -1521,15 +1506,25 @@ CREATE TABLE t1 (
id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id)
) ENGINE=InnoDB;
CREATE TABLE t2 (
id INTEGER NOT NULL,
FOREIGN KEY (id) REFERENCES t1 (id)
) ENGINE=InnoDB;
INSERT INTO t1 (id) VALUES (NULL);
SELECT * FROM t1;
--error ER_TRUNCATE_ILLEGAL_FK
TRUNCATE t1;
INSERT INTO t1 (id) VALUES (NULL);
SELECT * FROM t1;
# continued from above; test that doing a slow TRUNCATE on a table with 0
# rows resets autoincrement columns
# continued from above; test that doing a TRUNCATE resets AUTO_INCREMENT
DELETE FROM t1;
--error ER_TRUNCATE_ILLEGAL_FK
TRUNCATE t1;
INSERT INTO t1 (id) VALUES (NULL);
SELECT * FROM t1;
DROP TABLE t2;
TRUNCATE t1;
INSERT INTO t1 (id) VALUES (NULL);
SELECT * FROM t1;
@ -1541,7 +1536,7 @@ CREATE TABLE t1
id INT PRIMARY KEY
) ENGINE=InnoDB;
--error ER_CANNOT_ADD_FOREIGN,1005
--error ER_CANT_CREATE_TABLE
CREATE TEMPORARY TABLE t2
(
id INT NOT NULL PRIMARY KEY,
@ -1630,7 +1625,7 @@ CREATE TABLE t2
CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id)
) ENGINE=InnoDB;
--error 1452
--error ER_NO_REFERENCED_ROW_2
INSERT INTO t2 VALUES(2);
INSERT INTO t1 VALUES(1);
@ -1639,14 +1634,14 @@ INSERT INTO t2 VALUES(1);
--error ER_ROW_IS_REFERENCED_2
DELETE FROM t1 WHERE id = 1;
--error ER_ROW_IS_REFERENCED_2, 1217
--error ER_ROW_IS_REFERENCED_2
DROP TABLE t1;
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE t1;
SET FOREIGN_KEY_CHECKS=1;
--error 1452
--error ER_NO_REFERENCED_ROW_2
INSERT INTO t2 VALUES(3);
DROP TABLE t2;
@ -1702,7 +1697,7 @@ set foreign_key_checks=0;
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
-- error 1005
--error ER_CANT_CREATE_TABLE
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
set foreign_key_checks=1;
drop table t2;
@ -1714,7 +1709,7 @@ set foreign_key_checks=0;
create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
-- error 1005
--error ER_CANT_CREATE_TABLE
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
set foreign_key_checks=1;
drop table t1;
@ -1946,7 +1941,7 @@ SET sql_mode = default;
#insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12);
#
#delimiter |;
#create trigger t1t before insert on t1 for each row begin
#create trigger t1t before insert on t1 for each row begin
# INSERT INTO t2 SET a = NEW.a;
#end |
#
@ -1954,7 +1949,7 @@ SET sql_mode = default;
# DELETE FROM t3 WHERE a = NEW.a;
#end |
#
#create trigger t3t before delete on t3 for each row begin
#create trigger t3t before delete on t3 for each row begin
# UPDATE t4 SET b = b + 1 WHERE a = OLD.a;
#end |
#
@ -2078,7 +2073,7 @@ create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
commit;
SET binlog_format='MIXED';
set autocommit = 0;
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t1 set b = 5 where b = 1;
connection b;
@ -2086,7 +2081,7 @@ SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
#
# X-lock to record (7,3) should be released in a update
# X-lock to record (7,3) should be released in a update
#
select * from t1 where a = 7 and b = 3 for update;
connection a;
@ -2109,7 +2104,7 @@ connection a;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2);
commit;
set autocommit = 0;
set autocommit = 0;
select * from t1 lock in share mode;
update t1 set b = 5 where b = 1;
connection b;
@ -2117,12 +2112,12 @@ set autocommit = 0;
#
# S-lock to records (2,2),(4,2), and (6,2) should not be released in a update
#
--error 1205
--error ER_LOCK_WAIT_TIMEOUT
select * from t1 where a = 2 and b = 2 for update;
#
# X-lock to record (1,1),(3,1),(5,1) should not be released in a update
#
--error 1205
--error ER_LOCK_WAIT_TIMEOUT
connection a;
commit;
connection b;
@ -2166,7 +2161,7 @@ disconnect b;
drop table t1, t2, t3;
#
# Consistent read should not be used if
# Consistent read should not be used if
#
# (a) isolation level is serializable OR
# (b) select ... lock in share mode OR
@ -2262,39 +2257,39 @@ SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update;
connection b;
--error 1205
--error ER_LOCK_WAIT_TIMEOUT
reap;
connection c;
--error 1205
--error ER_LOCK_WAIT_TIMEOUT
reap;
connection d;
--error 1205
--error ER_LOCK_WAIT_TIMEOUT
reap;
connection e;
--error 1205
--error ER_LOCK_WAIT_TIMEOUT
reap;
connection f;
--error 1205
--error ER_LOCK_WAIT_TIMEOUT
reap;
connection g;
--error 1205
--error ER_LOCK_WAIT_TIMEOUT
reap;
connection h;
--error 1205
--error ER_LOCK_WAIT_TIMEOUT
reap;
connection i;
--error 1205
--error ER_LOCK_WAIT_TIMEOUT
reap;
connection j;
--error 1205
--error ER_LOCK_WAIT_TIMEOUT
reap;
connection a;
@ -2331,8 +2326,8 @@ CREATE TABLE t2 (
b VARCHAR(128) NOT NULL,
c TEXT NOT NULL,
PRIMARY KEY (a,b),
KEY idx_t2_b_c (b,c(200)),
CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a)
KEY idx_t2_b_c (b,c(100)),
CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a)
ON DELETE CASCADE
) ENGINE=INNODB DEFAULT CHARSET=UTF8;
@ -2457,7 +2452,7 @@ INSERT INTO t1 VALUES(-10);
SELECT * FROM t1;
#
# NOTE: The server really needs to be restarted at this point
# for the test to be useful.
# for the test to be useful.
#
# Without the fix InnoDB would trip over an assertion here.
INSERT INTO t1 VALUES(NULL);