-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-13626: Merge InnoDB test cases from MySQL 5.7 (part 6)
innodb.truncate_inject: Replacement for innodb_zip.wl6501_error_1 Note: unlike MySQL, in some cases TRUNCATE does not return an error in MariaDB. This should be fixed in the scope of MDEV-13564 or similar.
- Loading branch information
Showing
3 changed files
with
211 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
SET @save_dbug = @@SESSION.debug_dbug; | ||
call mtr.add_suppression("InnoDB: Flagged corruption of .* in table `test`\\.`t` in TRUNCATE TABLE"); | ||
# 1. Error in assigning undo logs for truncate action | ||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c)) | ||
ENGINE = InnoDB; | ||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); | ||
check table t; | ||
Table Op Msg_type Msg_text | ||
test.t check status OK | ||
SET debug_dbug = '+d,ib_err_trunc_assigning_undo_log'; | ||
truncate table t; | ||
ERROR HY000: Got error 168 "Unknown (generic) error from engine" from storage engine InnoDB | ||
SET debug_dbug = @save_dbug; | ||
check table t; | ||
Table Op Msg_type Msg_text | ||
test.t check status OK | ||
select * from t; | ||
i f c | ||
1 1.1 a | ||
2 2.2 b | ||
3 3.3 c | ||
# 2. Error while preparing for truncate | ||
SET debug_dbug = '+d,ib_err_trunc_preparing_for_truncate'; | ||
truncate table t; | ||
ERROR HY000: Got error 168 "Unknown (generic) error from engine" from storage engine InnoDB | ||
SET debug_dbug = @save_dbug; | ||
check table t; | ||
Table Op Msg_type Msg_text | ||
test.t check status OK | ||
select * from t; | ||
i f c | ||
1 1.1 a | ||
2 2.2 b | ||
3 3.3 c | ||
# 3. Error while dropping/creating indexes | ||
SET debug_dbug = '+d,ib_err_trunc_drop_index'; | ||
truncate table t; | ||
ERROR HY000: Got error 168 "Unknown (generic) error from engine" from storage engine InnoDB | ||
SET debug_dbug = @save_dbug; | ||
check table t; | ||
Table Op Msg_type Msg_text | ||
test.t check Warning InnoDB: Index PRIMARY is marked as corrupted | ||
test.t check error Corrupt | ||
select * from t; | ||
Got one of the listed errors | ||
drop table t; | ||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c)) | ||
ENGINE = InnoDB; | ||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); | ||
check table t; | ||
Table Op Msg_type Msg_text | ||
test.t check status OK | ||
SET debug_dbug = '+d,ib_err_trunc_create_index'; | ||
truncate table t; | ||
ERROR HY000: Got error 168 "Unknown (generic) error from engine" from storage engine InnoDB | ||
SET debug_dbug = @save_dbug; | ||
check table t; | ||
Table Op Msg_type Msg_text | ||
test.t check Warning InnoDB: Index PRIMARY is marked as corrupted | ||
test.t check error Corrupt | ||
select * from t; | ||
Got one of the listed errors | ||
drop table t; | ||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c)) | ||
ENGINE = InnoDB; | ||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); | ||
check table t; | ||
Table Op Msg_type Msg_text | ||
test.t check status OK | ||
SET debug_dbug = '+d,ib_err_trunc_temp_recreate_index'; | ||
truncate table t; | ||
SET debug_dbug = @save_dbug; | ||
check table t; | ||
Table Op Msg_type Msg_text | ||
test.t check status OK | ||
select * from t; | ||
i f c | ||
drop table t; | ||
# 4. Error while completing truncate of table involving FTS | ||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), | ||
FULLTEXT INDEX(c)) ENGINE = InnoDB; | ||
insert into t values (1, 1.1, 'mysql is now oracle company'), | ||
(2, 2.2, 'innodb is part of mysql'), | ||
(3, 3.3, 'innodb is default storage engine of mysql'); | ||
check table t; | ||
Table Op Msg_type Msg_text | ||
test.t check status OK | ||
SET debug_dbug = '+d,ib_err_trunc_temp_recreate_index'; | ||
truncate table t; | ||
SET debug_dbug = @save_dbug; | ||
check table t; | ||
Table Op Msg_type Msg_text | ||
test.t check status OK | ||
select * from t; | ||
i f c | ||
drop table t; | ||
# 5. Error while updating sys-tables | ||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), | ||
FULLTEXT INDEX(c)) ENGINE = InnoDB; | ||
insert into t values (1, 1.1, 'mysql is now oracle company'), | ||
(2, 2.2, 'innodb is part of mysql'), | ||
(3, 3.3, 'innodb is default storage engine of mysql'); | ||
check table t; | ||
Table Op Msg_type Msg_text | ||
test.t check status OK | ||
SET debug_dbug = '+d,ib_err_trunc_temp_recreate_index'; | ||
truncate table t; | ||
SET debug_dbug = @save_dbug; | ||
check table t; | ||
Table Op Msg_type Msg_text | ||
test.t check status OK | ||
select * from t order by i; | ||
i f c | ||
drop table t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# This test is based on innodb_zip.wl6501_error_1 in MySQL 5.7. | ||
|
||
--source include/have_innodb.inc | ||
--source include/innodb_row_format.inc | ||
--source include/have_debug.inc | ||
|
||
SET @save_dbug = @@SESSION.debug_dbug; | ||
|
||
call mtr.add_suppression("InnoDB: Flagged corruption of .* in table `test`\\.`t` in TRUNCATE TABLE"); | ||
|
||
--echo # 1. Error in assigning undo logs for truncate action | ||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c)) | ||
ENGINE = InnoDB; | ||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); | ||
check table t; | ||
# | ||
SET debug_dbug = '+d,ib_err_trunc_assigning_undo_log'; | ||
--error ER_GET_ERRNO | ||
truncate table t; | ||
SET debug_dbug = @save_dbug; | ||
check table t; | ||
select * from t; | ||
|
||
--echo # 2. Error while preparing for truncate | ||
SET debug_dbug = '+d,ib_err_trunc_preparing_for_truncate'; | ||
--error ER_GET_ERRNO | ||
truncate table t; | ||
SET debug_dbug = @save_dbug; | ||
check table t; | ||
select * from t; | ||
|
||
--echo # 3. Error while dropping/creating indexes | ||
SET debug_dbug = '+d,ib_err_trunc_drop_index'; | ||
--error ER_GET_ERRNO | ||
truncate table t; | ||
SET debug_dbug = @save_dbug; | ||
check table t; | ||
--error ER_TABLE_CORRUPT,ER_GET_ERRNO | ||
select * from t; | ||
drop table t; | ||
|
||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c)) | ||
ENGINE = InnoDB; | ||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); | ||
check table t; | ||
|
||
SET debug_dbug = '+d,ib_err_trunc_create_index'; | ||
--error ER_GET_ERRNO | ||
truncate table t; | ||
SET debug_dbug = @save_dbug; | ||
check table t; | ||
--error ER_TABLE_CORRUPT,ER_GET_ERRNO | ||
select * from t; | ||
drop table t; | ||
|
||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), INDEX ck(c)) | ||
ENGINE = InnoDB; | ||
insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c'); | ||
check table t; | ||
|
||
SET debug_dbug = '+d,ib_err_trunc_temp_recreate_index'; | ||
truncate table t; | ||
SET debug_dbug = @save_dbug; | ||
|
||
check table t; | ||
select * from t; | ||
drop table t; | ||
|
||
--echo # 4. Error while completing truncate of table involving FTS | ||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), | ||
FULLTEXT INDEX(c)) ENGINE = InnoDB; | ||
insert into t values (1, 1.1, 'mysql is now oracle company'), | ||
(2, 2.2, 'innodb is part of mysql'), | ||
(3, 3.3, 'innodb is default storage engine of mysql'); | ||
check table t; | ||
SET debug_dbug = '+d,ib_err_trunc_temp_recreate_index'; | ||
truncate table t; | ||
SET debug_dbug = @save_dbug; | ||
|
||
check table t; | ||
select * from t; | ||
drop table t; | ||
|
||
--echo # 5. Error while updating sys-tables | ||
CREATE TABLE t (i int PRIMARY KEY, f float UNIQUE, c char(100), | ||
FULLTEXT INDEX(c)) ENGINE = InnoDB; | ||
insert into t values (1, 1.1, 'mysql is now oracle company'), | ||
(2, 2.2, 'innodb is part of mysql'), | ||
(3, 3.3, 'innodb is default storage engine of mysql'); | ||
check table t; | ||
SET debug_dbug = '+d,ib_err_trunc_temp_recreate_index'; | ||
truncate table t; | ||
SET debug_dbug = @save_dbug; | ||
|
||
check table t; | ||
select * from t order by i; | ||
drop table t; |
Oops, something went wrong.