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

Merge branch '11.2' into 11.4

This commit is contained in:
Oleksandr Byelkin
2024-10-30 09:24:04 +01:00
734 changed files with 10187 additions and 4442 deletions

View File

@ -50,4 +50,20 @@ ALTER TABLE t2 ALGORITHM=COPY, FORCE;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
DROP TABLE t2, t1;
#
# MDEV-35237 Bulk insert fails to apply buffered
# operation during copy alter
#
CREATE TABLE t1 (f1 int NOT NULL, f2 tinyint(1) NOT NULL,
f3 varchar(80) NOT NULL, PRIMARY KEY(f1),
KEY(f2), KEY(f3))ENGINE=InnoDB;
INSERT INTO t1 VALUES(1,1,''),(2,0,''), (4,1,'e');
CREATE TABLE t2 (f1 int NOT NULL, f2 int NOT NULL,KEY(f1))ENGINE=InnoDB;
INSERT INTO t2 VALUES (1,0),(1,0);
CREATE TABLE t engine=innodb
SELECT t2.f2 FROM t2 JOIN t1 ON t1.f1 = t2.f1 AND t1.f3 = '' AND t1.f2=1 ;
SELECT COUNT(*) FROM t;
COUNT(*)
2
DROP TABLE t1, t2, t;
SET GLOBAL innodb_stats_persistent=@default_stats_persistent;

View File

@ -8,8 +8,10 @@ INSERT INTO t2 VALUES(1);
# Corrupt the pages
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Page \[page id: space=[1-9][0-9]*, page number=3\] log sequence number 1311768467463790320 is in the future!/ in mysqld.1.err
SELECT * FROM t1;
Got one of the listed errors
a
1
SELECT * FROM t2;
a
1
@ -27,7 +29,7 @@ SET GLOBAL innodb_flush_log_at_trx_commit=1;
DELETE FROM t1 WHERE pk=3;
# Kill the server
disconnect con1;
# Corrupt the pages
# Corrupt the page
SELECT * FROM t1;
pk
1

View File

@ -0,0 +1,21 @@
#
# MDEV-35144 CREATE TABLE ... LIKE uses current innodb_compression_default instead of the create value
#
set innodb_compression_default= off;
create table t1 (a int, b blob) engine=innodb;
set innodb_compression_default= on;
create table s_import like t1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` blob DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
show create table s_import;
Table Create Table
s_import CREATE TABLE `s_import` (
`a` int(11) DEFAULT NULL,
`b` blob DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1,s_import;
# End of 10.5 tests

View File

@ -8,3 +8,13 @@ connection default;
ERROR 70100: Query execution was interrupted
CREATE TABLE t1 (a SERIAL) ENGINE=InnoDB;
DROP TABLE t1;
# End of 10.2 tests
#
# MDEV-35236 Assertion `(mem_root->flags & 4) == 0' failed in safe_lexcstrdup_root
#
prepare stmt from 'create or replace table t engine=innodb select 1 as f';
set innodb_compression_default=on;
execute stmt;
execute stmt;
drop table t;
# End of 10.5 tests

View File

@ -21,8 +21,8 @@ connection default;
flush table t1 for export;
# Kill the server
# restart
FOUND 1 /InnoDB: Restoring page \[page id: space=[1-9][0-9]*, page number=0\] of datafile/ in mysqld.1.err
FOUND 1 /InnoDB: Recovered page \[page id: space=[1-9][0-9]*, page number=3\]/ in mysqld.1.err
FOUND 1 /InnoDB: Recovered page \[page id: space=[1-9][0-9]*, page number=0\]/ in mysqld.1.err
# restart
XA ROLLBACK 'x';
check table t1;
Table Op Msg_type Msg_text
@ -44,7 +44,7 @@ connection default;
flush table t1 for export;
# Kill the server
# restart
FOUND 1 /InnoDB: Restoring page \[page id: space=[1-9][0-9]*, page number=0\] of datafile/ in mysqld.1.err
FOUND 4 /InnoDB: Recovered page \[page id: space=[1-9][0-9]*, page number=[03]\]/ in mysqld.1.err
XA ROLLBACK 'x';
check table t1;
Table Op Msg_type Msg_text

View File

@ -37,7 +37,7 @@ set global innodb_buf_flush_list_now = 1;
# Make the 1st page (page_no=0) and 2nd page (page_no=1)
# of the system tablespace all zeroes.
# restart
FOUND 1 /InnoDB: Restoring page \[page id: space=0, page number=0\] of datafile/ in mysqld.1.err
FOUND 1 /InnoDB: Recovered page \[page id: space=0, page number=0\]/ in mysqld.1.err
FOUND 1 /InnoDB: Recovered page \[page id: space=0, page number=1\]/ in mysqld.1.err
check table t1;
Table Op Msg_type Msg_text
@ -66,7 +66,7 @@ set global innodb_buf_flush_list_now = 1;
# Kill the server
# Corrupt the 1st page (page_no=0) and 2nd page of the system tablespace.
# restart
FOUND 2 /InnoDB: Restoring page \[page id: space=0, page number=0\] of datafile/ in mysqld.1.err
FOUND 2 /InnoDB: Recovered page \[page id: space=0, page number=0\]/ in mysqld.1.err
FOUND 2 /InnoDB: Recovered page \[page id: space=0, page number=1\]/ in mysqld.1.err
check table t1;
Table Op Msg_type Msg_text

View File

@ -9,8 +9,8 @@ call mtr.add_suppression("InnoDB: Page for tablespace ");
call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=");
call mtr.add_suppression("InnoDB: Unknown index id .* on page");
call mtr.add_suppression("InnoDB: Cannot save statistics for table `test`\\.`t1` because the \\.ibd file is missing");
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*ibdata1' page");
call mtr.add_suppression("InnoDB: File '.*ibdata1' is corrupted");
call mtr.add_suppression("InnoDB: Failed to read page \\d+ from file '.*test/t1\\.ibd'");
call mtr.add_suppression("InnoDB: File '.*(ibdata1|t1\\.ibd)' is corrupted");
FLUSH TABLES;
CREATE TABLE t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES(1),(2),(3);

View File

@ -1305,7 +1305,7 @@ ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fail
update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`))
update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
ERROR 42S22: Unknown column 't1.id' in 'where clause'
ERROR 42S22: Unknown column 't1.id' in 'WHERE'
drop table t3,t2,t1;
CREATE TABLE t1 (
c1 VARCHAR(8), c2 VARCHAR(8),

View File

@ -2556,7 +2556,7 @@ INSERT INTO t1 VALUES (1),(2),(3),(4);
INSERT INTO t3 SELECT * FROM t1;
** An error in a trigger causes rollback of the statement.
DELETE t1 FROM t3 LEFT JOIN t1 ON t1.i=t3.i;
ERROR 42S22: Unknown column 'error_happens_here' in 'field list'
ERROR 42S22: Unknown column 'error_happens_here' in 'SET'
SELECT @a,@b;
@a @b
EXECUTED TRIGGER
@ -2570,7 +2570,7 @@ i i
4 4
** Same happens with the IGNORE option
DELETE IGNORE t1 FROM t3 LEFT JOIN t1 ON t1.i=t3.i;
ERROR 42S22: Unknown column 'error_happens_here' in 'field list'
ERROR 42S22: Unknown column 'error_happens_here' in 'SET'
SELECT * FROM t2;
a
SELECT * FROM t1 LEFT JOIN t3 ON t1.i=t3.i;

View File

@ -552,18 +552,18 @@ ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=never. Try ALGORITHM=INPLACE
SET GLOBAL innodb_instant_alter_column_allowed = add_last;
ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
ALTER TABLE t1 ADD d TEXT AFTER a, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
SET GLOBAL innodb_instant_alter_column_allowed = add_drop_reorder;
ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
SET GLOBAL innodb_instant_alter_column_allowed = add_last;
ALTER TABLE t1 MODIFY a INT DEFAULT 1, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
ALTER TABLE t1 ADD d TEXT AFTER a, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
ALTER TABLE t1 MODIFY a INT DEFAULT 0, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
ALTER TABLE t1 MODIFY a INT DEFAULT 0;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
@ -1486,18 +1486,18 @@ ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=never. Try ALGORITHM=INPLACE
SET GLOBAL innodb_instant_alter_column_allowed = add_last;
ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
ALTER TABLE t1 ADD d TEXT AFTER a, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
SET GLOBAL innodb_instant_alter_column_allowed = add_drop_reorder;
ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
SET GLOBAL innodb_instant_alter_column_allowed = add_last;
ALTER TABLE t1 MODIFY a INT DEFAULT 1, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
ALTER TABLE t1 ADD d TEXT AFTER a, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
ALTER TABLE t1 MODIFY a INT DEFAULT 0, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
ALTER TABLE t1 MODIFY a INT DEFAULT 0;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
@ -2420,18 +2420,18 @@ ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=never. Try ALGORITHM=INPLACE
SET GLOBAL innodb_instant_alter_column_allowed = add_last;
ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
ALTER TABLE t1 ADD d TEXT AFTER a, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
SET GLOBAL innodb_instant_alter_column_allowed = add_drop_reorder;
ALTER TABLE t1 MODIFY b TEXT FIRST, ALGORITHM=INSTANT;
SET GLOBAL innodb_instant_alter_column_allowed = add_last;
ALTER TABLE t1 MODIFY a INT DEFAULT 1, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
ALTER TABLE t1 ADD d TEXT AFTER a, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
ALTER TABLE t1 MODIFY a INT DEFAULT 0, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_atler_column_allowed=add_last. Try ALGORITHM=INPLACE
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: innodb_instant_alter_column_allowed=add_last. Try ALGORITHM=INPLACE
ALTER TABLE t1 MODIFY a INT DEFAULT 0;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0

View File

@ -526,6 +526,15 @@ c INT as (b) VIRTUAL)ENGINE=InnoDB CHARACTER SET utf32;
ALTER TABLE t1 DROP COLUMN a;
ALTER TABLE t1 DROP COLUMN c;
DROP TABLE t1;
#
# MDEV-35122 Incorrect NULL value handling for instantly
# dropped BLOB columns
#
CREATE TABLE t1 (c1 INT, c2 BLOB, c3 BLOB NOT NULL) ROW_FORMAT=REDUNDANT,ENGINE=InnoDB;
ALTER TABLE t1 DROP c2;
ALTER TABLE t1 DROP c3;
INSERT INTO t1 VALUES(1);
DROP TABLE t1;
# End of 10.5 tests
# End of 10.6 tests
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;

View File

@ -134,8 +134,10 @@ BEGIN;
INSERT INTO t SET a=2;
connection consistent;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
SAVEPOINT sp1;
SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
ERROR HY000: Record has changed since last read in table 't'
SAVEPOINT sp1;
connection con_weird;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
@ -155,3 +157,4 @@ a b
disconnect consistent;
connection default;
DROP TABLE t;
# End of 10.6 tests

View File

@ -49,6 +49,7 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Could not measure the size of single-table tablespace file '.*test/t2\.ibd'/ in mysqld.1.err
# restart
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'

View File

@ -15,6 +15,7 @@ FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty';
set debug_dbug="d,trigger_garbage_collection";
SET GLOBAL innodb_buffer_pool_size=@@innodb_buffer_pool_size;
FOUND 1 /[Mm]emory pressure.*/ in mysqld.1.err
SELECT CAST(VARIABLE_VALUE AS INTEGER) < @dirty_prev AS LESS_DIRTY_IS_GOOD
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty';

View File

@ -0,0 +1,6 @@
create table t_compressed(b longblob) engine=InnoDB page_compressed=1;
insert into t_compressed values(repeat(1,1000000));
select allocated_size < file_size from information_schema.innodb_sys_tablespaces where name='test/t_compressed';
allocated_size < file_size
1
drop table t_compressed;

View File

@ -6,3 +6,4 @@ FOUND 1 /page id mismatch/ in result.log
InnoDB 0 transactions not purged
drop table t1;
call mtr.add_suppression("InnoDB: Failed to read page 3 from file '.*test/t1\\.ibd': Page read from tablespace is corrupted\\.");
call mtr.add_suppression("InnoDB: File '.*t1\\.ibd' is corrupted");

View File

@ -1,5 +1,6 @@
FLUSH TABLES;
call mtr.add_suppression("Found 1 prepared XA transactions");
call mtr.add_suppression("InnoDB: Cannot free the unused segments in system tablespace because a previous shutdown was not with innodb_fast_shutdown=0 or XA PREPARE transactions exist");
#
# MDEV-13797 InnoDB may hang if shutdown is initiated soon after startup
# while rolling back recovered incomplete transactions

View File

@ -19,13 +19,20 @@ InnoDB 0 transactions not purged
SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
NAME FILE_SIZE
innodb_system 540016640
# restart: --debug_dbug=+d,shrink_buffer_pool_full
# restart: --debug_dbug=+d,traversal_extent_fail
FOUND 1 /\[Warning\] InnoDB: Cannot shrink the system tablespace/ in mysqld.1.err
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES
# restart: --debug_dbug=+d,shrink_buffer_pool_full
FOUND 2 /\[Warning\] InnoDB: Cannot shrink the system tablespace/ in mysqld.1.err
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES
# restart: --debug_dbug=+d,mtr_log_max_size
FOUND 1 /\[ERROR\] InnoDB: Cannot shrink the system tablespace/ in mysqld.1.err
SELECT * FROM INFORMATION_SCHEMA.ENGINES

View File

@ -151,7 +151,7 @@ t1 CREATE TEMPORARY TABLE `t1` (
UNIQUE KEY `pri_index` (`t1_i`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
select * from t1 where t1_f >= 2.5;
ERROR 42S22: Unknown column 't1_f' in 'where clause'
ERROR 42S22: Unknown column 't1_f' in 'WHERE'
alter table t1 add index sec_index2(t1_c), algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
drop table t1;

View File

@ -0,0 +1,25 @@
# restart: --debug_dbug=d,undo_segment_leak
SET GLOBAL INNODB_FILE_PER_TABLE=0;
Warnings:
Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL)ENGINE=InnoDB;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
UPDATE t1 SET f1 = f1 + 1 WHERE f1 > 1000;
UPDATE t1 SET f2 = f2 + 1 WHERE f1 > 1000;
UPDATE t1 SET f1 = f2 + 1 WHERE f1 > 1000;
UPDATE t1 SET f2 = f1 + 1 WHERE f1 > 1000;
DELETE FROM t1;
DROP TABLE t1;
set GLOBAL innodb_fast_shutdown=0;
SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
NAME FILE_SIZE
innodb_system 79691776
# restart
SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
NAME FILE_SIZE
innodb_system 12582912

View File

@ -0,0 +1,94 @@
call mtr.add_suppression("InnoDB: Cannot free the unused segments in system tablespace because a previous shutdown was not with innodb_fast_shutdown=0");
call mtr.add_suppression("InnoDB: :autoshrink failed to read the used segment");
call mtr.add_suppression("InnoDB: :autoshrink failed due to .* in FSP_SEG_INODES_FULL list");
call mtr.add_suppression("InnoDB: :autoshrink failed due to .* in FSP_SEG_INODES_FREE list");
call mtr.add_suppression("InnoDB: :autoshrink failed to free the segment");
call mtr.add_suppression("Found .* prepared XA transactions");
SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
NAME FILE_SIZE
innodb_system 10485760
SET GLOBAL INNODB_FILE_PER_TABLE=0;
Warnings:
Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL)STATS_PERSISTENT=0, ENGINE=InnoDB;
XA START 'x';
insert into t1 values (1, 1);
XA END 'x';
XA PREPARE 'x';
set GLOBAL innodb_fast_shutdown=0;
# restart
# Fail to free the segment due to XA PREPARE transaction
FOUND 2 /InnoDB: Cannot free the unused segments in system tablespace because a previous shutdown was not with innodb_fast_shutdown=0/ in mysqld.1.err
XA COMMIT 'x';
DROP TABLE t1;
# restart: --debug_dbug=d,undo_segment_leak
SET GLOBAL INNODB_FILE_PER_TABLE=0;
Warnings:
Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL)STATS_PERSISTENT=0, ENGINE=InnoDB;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
UPDATE t1 SET f1 = f1 + 1 WHERE f1 > 1000;
UPDATE t1 SET f2 = f2 + 1 WHERE f1 > 1000;
UPDATE t1 SET f1 = f2 + 1 WHERE f1 > 1000;
UPDATE t1 SET f2 = f1 + 1 WHERE f1 > 1000;
DELETE FROM t1;
DROP TABLE t1;
SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
NAME FILE_SIZE
innodb_system 77594624
# restart: --debug_dbug=d,unused_undo_free_fail_1
# Fail to free the segment due to previous shutdown
FOUND 4 /InnoDB: Cannot free the unused segments in system tablespace because a previous shutdown was not with innodb_fast_shutdown=0/ in mysqld.1.err
SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
NAME FILE_SIZE
innodb_system 15728640
SET GLOBAL innodb_fast_shutdown= 0;
# Fail to free the segment while finding the used segments
# restart: --debug_dbug=d,unused_undo_free_fail_2
SELECT IF(file_size>10485760,'ok',file_size) FROM information_schema.innodb_sys_tablespaces WHERE space=0;
IF(file_size>10485760,'ok',file_size)
ok
FOUND 1 /InnoDB: :autoshrink failed to read the used segment/ in mysqld.1.err
FOUND 1 /InnoDB: :autoshrink failed due to .* in FSP_SEG_INODES_FULL list/ in mysqld.1.err
SET GLOBAL innodb_fast_shutdown= 0;
# Fail to free the segment while finding the used segments
# restart: --debug_dbug=d,unused_undo_free_fail_3
SELECT IF(file_size>10485760,'ok',file_size) FROM information_schema.innodb_sys_tablespaces WHERE space=0;
IF(file_size>10485760,'ok',file_size)
ok
FOUND 1 /InnoDB: :autoshrink failed due to .* in FSP_SEG_INODES_FREE list/ in mysqld.1.err
SET GLOBAL innodb_fast_shutdown= 0;
# Fail to free the segment while freeing the unused segments
# restart: --debug_dbug=d,unused_undo_free_fail_4
SELECT IF(file_size>10485760,'ok',file_size) FROM information_schema.innodb_sys_tablespaces WHERE space=0;
IF(file_size>10485760,'ok',file_size)
ok
FOUND 1 /InnoDB: :autoshrink failed to free the segment .* in page .*/ in mysqld.1.err
SET GLOBAL innodb_fast_shutdown= 0;
# Fail to free the segment while freeing the used segments
# restart: --debug_dbug=d,unused_undo_free_fail_5
SELECT IF(file_size>10485760,'ok',file_size) FROM information_schema.innodb_sys_tablespaces WHERE space=0;
IF(file_size>10485760,'ok',file_size)
ok
FOUND 1 /InnoDB: :autoshrink failed to free the segment .* in page .*/ in mysqld.1.err
SET GLOBAL innodb_fast_shutdown= 0;
# restart
SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
NAME FILE_SIZE
innodb_system 10485760
# Fail to reset the TRX_SYS_FSEG_HEADER during undo tablespace
# reinitialization. garbage_collect() shouldn't free the
# TRX_SYS_FSEG_HEADER index node
set global innodb_fast_shutdown=0;
# restart: --innodb_undo_tablespaces=2 --debug_dbug=d,sys_fseg_header_fail
FOUND 1 /InnoDB: :autoshrink freed the segment .* in page .*/ in mysqld.1.err
set global innodb_fast_shutdown=0;
# restart
SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
NAME FILE_SIZE
innodb_system 10485760

View File

@ -12,7 +12,7 @@ set global innodb_fil_make_page_dirty_debug = 1;
SET GLOBAL innodb_buf_flush_list_now = 1;
# Kill the server
# restart: --debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0
FOUND 1 /Restoring page \[page id: space=1, page number=0\] of datafile '.*undo001' from the doublewrite buffer./ in mysqld.1.err
FOUND 1 /Recovered page \[page id: space=1, page number=0\] to '.*undo001' from the doublewrite buffer\./ in mysqld.1.err
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK

View File

@ -0,0 +1,66 @@
SET @old_innodb_enable_xap_unlock_unmodified_for_primary_debug=
@@GLOBAL.innodb_enable_xap_unlock_unmodified_for_primary_debug;
SET GLOBAL innodb_enable_xap_unlock_unmodified_for_primary_debug= 1;
BEGIN NOT ATOMIC
DECLARE c TEXT DEFAULT(
SELECT CONCAT(
'CREATE TABLE t1(pk',
GROUP_CONCAT(seq SEPARATOR ' INT, pk'), ' INT, a',
GROUP_CONCAT(seq SEPARATOR ' INT, a'), ' INT, b',
GROUP_CONCAT(seq SEPARATOR ' INT, b'), ' INT, c INT, PRIMARY KEY(pk',
GROUP_CONCAT(seq SEPARATOR ', pk'), '), INDEX i1(a',
GROUP_CONCAT(seq SEPARATOR ', a'), '), INDEX i2(b',
GROUP_CONCAT(seq SEPARATOR ', b'), ')) ENGINE=InnoDB;')
FROM seq_1_to_32);
EXECUTE IMMEDIATE c;
END;
$$
BEGIN NOT ATOMIC
DECLARE c TEXT DEFAULT(
SELECT CONCAT(
'INSERT INTO t1 VALUES (',
GROUP_CONCAT('1' SEPARATOR ','), ',',
GROUP_CONCAT('1' SEPARATOR ','), ',',
GROUP_CONCAT('1' SEPARATOR ','), ',0), (',
GROUP_CONCAT('2' SEPARATOR ','), ',',
GROUP_CONCAT('1' SEPARATOR ','), ',',
GROUP_CONCAT('2' SEPARATOR ','), ',0), (',
GROUP_CONCAT('3' SEPARATOR ','), ',',
GROUP_CONCAT('2' SEPARATOR ','), ',',
GROUP_CONCAT('1' SEPARATOR ','), ',0), (',
GROUP_CONCAT('4' SEPARATOR ','), ',',
GROUP_CONCAT('2' SEPARATOR ','), ',',
GROUP_CONCAT('2' SEPARATOR ','), ',0);')
FROM seq_1_to_32);
EXECUTE IMMEDIATE c;
END;
$$
SET @old_timeout= @@GLOBAL.innodb_lock_wait_timeout;
SET GLOBAL innodb_lock_wait_timeout= 1;
XA START "t1";
UPDATE t1 FORCE INDEX (i2) SET c=c+1 WHERE a1=1 AND b1=1;
XA END "t1";
XA PREPARE "t1";
connect con1,localhost,root,,;
SELECT a1, b1, c FROM t1 FORCE INDEX (i1) WHERE a1=2 AND b1=1 FOR UPDATE;
a1 b1 c
2 1 0
disconnect con1;
connection default;
XA COMMIT "t1";
SET GLOBAL innodb_enable_xap_unlock_unmodified_for_primary_debug=
@old_innodb_enable_xap_unlock_unmodified_for_primary_debug;
SET GLOBAL innodb_lock_wait_timeout= @old_timeout;
BEGIN NOT ATOMIC
DECLARE c TEXT DEFAULT(
SELECT CONCAT(
'ALTER TABLE t1 ADD COLUMN d',
GROUP_CONCAT(seq SEPARATOR ' INT, ADD COLUMN d'),
' INT, ADD INDEX i3(d',
GROUP_CONCAT(seq SEPARATOR ', d'), ');')
FROM seq_1_to_33);
EXECUTE IMMEDIATE c;
END;
$$
ERROR 42000: Too many key parts specified; max 32 parts allowed
DROP TABLE t1;

View File

@ -0,0 +1,68 @@
SET @old_innodb_enable_xap_unlock_unmodified_for_primary_debug=
@@GLOBAL.innodb_enable_xap_unlock_unmodified_for_primary_debug;
SET GLOBAL innodb_enable_xap_unlock_unmodified_for_primary_debug= 1;
SET @saved_dbug = @@GLOBAL.debug_dbug;
CREATE TABLE t(id INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0;
InnoDB 0 transactions not purged
INSERT INTO t VALUES (10), (20), (30);
connect prevent_purge,localhost,root,,;
start transaction with consistent snapshot;
connection default;
DELETE FROM t WHERE id = 20;
SET @@GLOBAL.debug_dbug=
"+d,enable_row_purge_remove_clust_if_poss_low_sync_point";
XA START '1';
UPDATE t SET id=40 WHERE id=30;
XA END '1';
connection prevent_purge;
COMMIT;
SET DEBUG_SYNC=
'now WAIT_FOR row_purge_remove_clust_if_poss_low_before_delete';
SET @@GLOBAL.debug_dbug=
"-d,enable_row_purge_remove_clust_if_poss_low_sync_point";
connection default;
SET DEBUG_SYNC=
"lock_rec_unlock_unmodified_start SIGNAL lock_sys_latched WAIT_FOR cont";
XA PREPARE '1';
connection prevent_purge;
SET DEBUG_SYNC= 'now SIGNAL row_purge_remove_clust_if_poss_low_cont';
SET DEBUG_SYNC= 'now SIGNAL cont';
disconnect prevent_purge;
connection default;
XA COMMIT '1';
SET DEBUG_SYNC="RESET";
TRUNCATE TABLE t;
InnoDB 0 transactions not purged
INSERT INTO t VALUES (10), (20), (30);
connect prevent_purge,localhost,root,,;
start transaction with consistent snapshot;
connection default;
DELETE FROM t WHERE id = 20;
SET @@GLOBAL.debug_dbug=
"+d,enable_row_purge_remove_clust_if_poss_low_sync_point";
SET @@GLOBAL.debug_dbug="+d,skip_lock_release_on_prepare_try";
XA START '1';
UPDATE t SET id=40 WHERE id=30;
XA END '1';
connection prevent_purge;
COMMIT;
SET DEBUG_SYNC=
'now WAIT_FOR row_purge_remove_clust_if_poss_low_before_delete';
SET @@GLOBAL.debug_dbug=
"-d,enable_row_purge_remove_clust_if_poss_low_sync_point";
connection default;
SET DEBUG_SYNC=
"lock_rec_unlock_unmodified_start SIGNAL lock_sys_latched WAIT_FOR cont";
XA PREPARE '1';
connection prevent_purge;
SET DEBUG_SYNC= 'now SIGNAL row_purge_remove_clust_if_poss_low_cont';
SET DEBUG_SYNC= 'now SIGNAL cont';
disconnect prevent_purge;
connection default;
XA COMMIT '1';
SET DEBUG_SYNC="RESET";
TRUNCATE TABLE t;
SET @@GLOBAL.debug_dbug = @saved_dbug;
DROP TABLE t;
SET GLOBAL innodb_enable_xap_unlock_unmodified_for_primary_debug=
@old_innodb_enable_xap_unlock_unmodified_for_primary_debug;