1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge branch '11.8' into 12.0

This commit is contained in:
Oleksandr Byelkin
2025-06-18 07:50:39 +02:00
271 changed files with 4921 additions and 1348 deletions

View File

@@ -0,0 +1,47 @@
#
# MDEV-36017 Alter table aborts when temporary
# directory is full
#
SET SESSION DEFAULT_STORAGE_ENGINE=InnoDB;
CREATE TABLE t1(f1 CHAR(100) NOT NULL, f2 CHAR(100) NOT NULL,
f3 CHAR(100) NOT NULL, f4 CHAR(100) NOT NULL,
f5 CHAR(100) NOT NULL)ENGINE=InnoDB;
INSERT INTO t1 SELECT 'a', 'b', 'c', 'd', 'e' FROM seq_1_to_65536;
SET STATEMENT DEBUG_DBUG="+d,write_to_tmp_file_fail" FOR
CREATE TABLE t2 as SELECT * FROM t1;
ERROR HY000: Got error 59 'Temp file write failure' from InnoDB
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL, f2 CHAR(100),
f3 CHAR(100))ENGINE=InnoDB;
INSERT INTO t1 SELECT seq, 'a', 'b' FROM seq_1_to_1024;
SET STATEMENT DEBUG_DBUG="+d,write_to_tmp_file_fail" FOR
ALTER TABLE t1 FORCE, ALGORITHM=COPY;
ERROR HY000: Got error 59 'Temp file write failure' from InnoDB
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL, f2 CHAR(100),
f3 CHAR(100))ENGINE=InnoDB;
INSERT INTO t1 SELECT seq, 'a', 'b' FROM seq_1_to_4096;
SET DEBUG_SYNC="inplace_after_index_build SIGNAL dml_start WAIT_FOR dml_commit";
ALTER TABLE t1 ADD KEY(f1), ADD INDEX(f3(10));
connect con1,localhost,root,,,;
SET DEBUG_SYNC="now WAIT_FOR dml_start";
BEGIN;
INSERT INTO t1 SELECT * FROM t1;
SET STATEMENT DEBUG_DBUG="+d,os_file_write_fail" FOR COMMIT;
SET DEBUG_SYNC="now SIGNAL dml_commit";
connection default;
ERROR HY000: Temporary file write failure
disconnect con1;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
SET STATEMENT DEBUG_DBUG="+d,ddl_log_write_fail" FOR
CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB;
DROP TABLE t1;
CREATE TABLE t1(f1 TEXT, index(f1(2)))ENGINE=InnoDB;
INSERT INTO t1 VALUES('a');
set statement DEBUG_DBUG="+d,btr_page_alloc_fail" for
UPDATE t1 set f1= REPEAT('b', 12000);
ERROR HY000: The table 't1' is full
DROP TABLE t1;

View File

@@ -0,0 +1,25 @@
#
# MDEV-36017 Alter table aborts when temporary
# directory is full
#
CREATE TABLE t1(f1 INT NOT NULL, f2 CHAR(100),
f3 CHAR(100))ENGINE=InnoDB;
INSERT INTO t1 SELECT seq, 'a', 'b' FROM seq_1_to_4096;
SET DEBUG_SYNC="inplace_after_index_build SIGNAL dml_start WAIT_FOR dml_commit";
ALTER TABLE t1 ADD KEY(f1), ADD INDEX(f3(10));
connect con1,localhost,root,,,;
SET DEBUG_SYNC="now WAIT_FOR dml_start";
BEGIN;
INSERT INTO t1 SELECT * FROM t1;
SET STATEMENT DEBUG_DBUG="+d,os_file_write_fail" FOR COMMIT;
SET DEBUG_SYNC="now SIGNAL dml_commit";
connection default;
ERROR HY000: Temporary file write failure
disconnect con1;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
SET STATEMENT DEBUG_DBUG="+d,ddl_log_write_fail" FOR
CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB;
DROP TABLE t1;

View File

@@ -76,8 +76,7 @@ SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,ib_export_io_write_failure_1";
FLUSH TABLES t1 FOR EXPORT;
Warnings:
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
Warning 1004 Can't create file './test/t1.cfg' (errno: 9 "Bad file descriptor")
UNLOCK TABLES;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
@@ -86,8 +85,7 @@ INSERT INTO t1 VALUES (1);
SET SESSION debug_dbug="+d,ib_export_io_write_failure_2";
FLUSH TABLES t1 FOR EXPORT;
Warnings:
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
Warning 1004 Can't create file './test/t1.cfg' (errno: 9 "Bad file descriptor")
UNLOCK TABLES;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
@@ -96,8 +94,7 @@ INSERT INTO t1 VALUES (1);
SET SESSION debug_dbug="+d,ib_export_io_write_failure_3";
FLUSH TABLES t1 FOR EXPORT;
Warnings:
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
Warning 1004 Can't create file './test/t1.cfg' (errno: 9 "Bad file descriptor")
UNLOCK TABLES;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
@@ -106,8 +103,7 @@ INSERT INTO t1 VALUES (1);
SET SESSION debug_dbug="+d,ib_export_io_write_failure_4";
FLUSH TABLES t1 FOR EXPORT;
Warnings:
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
Warning 1004 Can't create file './test/t1.cfg' (errno: 9 "Bad file descriptor")
UNLOCK TABLES;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
@@ -116,8 +112,7 @@ INSERT INTO t1 VALUES (1);
SET SESSION debug_dbug="+d,ib_export_io_write_failure_5";
FLUSH TABLES t1 FOR EXPORT;
Warnings:
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
Warning 1004 Can't create file './test/t1.cfg' (errno: 9 "Bad file descriptor")
UNLOCK TABLES;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
@@ -126,8 +121,7 @@ INSERT INTO t1 VALUES (1);
SET SESSION debug_dbug="+d,ib_export_io_write_failure_6";
FLUSH TABLES t1 FOR EXPORT;
Warnings:
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
Warning 1004 Can't create file './test/t1.cfg' (errno: 9 "Bad file descriptor")
UNLOCK TABLES;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
@@ -136,8 +130,7 @@ INSERT INTO t1 VALUES (1);
SET SESSION debug_dbug="+d,ib_export_io_write_failure_7";
FLUSH TABLES t1 FOR EXPORT;
Warnings:
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
Warning 1004 Can't create file './test/t1.cfg' (errno: 9 "Bad file descriptor")
UNLOCK TABLES;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
@@ -146,8 +139,7 @@ INSERT INTO t1 VALUES (1);
SET SESSION debug_dbug="+d,ib_export_io_write_failure_8";
FLUSH TABLES t1 FOR EXPORT;
Warnings:
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
Warning 1004 Can't create file './test/t1.cfg' (errno: 9 "Bad file descriptor")
UNLOCK TABLES;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
@@ -156,8 +148,7 @@ INSERT INTO t1 VALUES (1);
SET SESSION debug_dbug="+d,ib_export_io_write_failure_10";
FLUSH TABLES t1 FOR EXPORT;
Warnings:
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
Warning 1004 Can't create file './test/t1.cfg' (errno: 9 "Bad file descriptor")
UNLOCK TABLES;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
@@ -166,8 +157,7 @@ INSERT INTO t1 VALUES (1);
SET SESSION debug_dbug="+d,ib_export_io_write_failure_11";
FLUSH TABLES t1 FOR EXPORT;
Warnings:
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
Warning 1004 Can't create file './test/t1.cfg' (errno: 9 "Bad file descriptor")
UNLOCK TABLES;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
@@ -176,8 +166,7 @@ INSERT INTO t1 VALUES (1);
SET SESSION debug_dbug="+d,ib_export_io_write_failure_12";
FLUSH TABLES t1 FOR EXPORT;
Warnings:
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
Warning 1004 Can't create file './test/t1.cfg' (errno: 9 "Bad file descriptor")
UNLOCK TABLES;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;

View File

@@ -18,6 +18,15 @@ SET STATEMENT foreign_key_checks=0, unique_checks=0 FOR
INSERT INTO t1 SELECT seq*4,seq*4 FROM seq_1_to_262144;
SET STATEMENT foreign_key_checks=0, unique_checks=0 FOR
INSERT INTO t2 SELECT seq*4,seq*4 FROM seq_1_to_16384;
SELECT @@GLOBAL.innodb_adaptive_hash_index;
@@GLOBAL.innodb_adaptive_hash_index
1
SET STATEMENT max_statement_time=1e-9 FOR
SET GLOBAL innodb_buffer_pool_size = 7340032;
SELECT @@GLOBAL.innodb_adaptive_hash_index;
@@GLOBAL.innodb_adaptive_hash_index
1
FOUND 1 /innodb_buffer_pool_size=7m.*resized from|innodb_buffer_pool_size change aborted/ in mysqld.1.err
set global innodb_buffer_pool_size = 7340032;
select count(val) from t1;
count(val)

View File

@@ -2,6 +2,16 @@ SET @save_limit=@@GLOBAL.innodb_limit_optimistic_insert_debug;
SET @save_size=@@GLOBAL.innodb_buffer_pool_size;
SET GLOBAL innodb_limit_optimistic_insert_debug=2;
SET GLOBAL innodb_buffer_pool_size=16777216;
call mtr.add_suppression("innodb_buffer_pool_size change aborted");
SET @old_innodb_adaptive_hash_index = @@innodb_adaptive_hash_index;
SET GLOBAL innodb_adaptive_hash_index = ON;
SET STATEMENT debug_dbug='+d,buf_shrink_fail' FOR
SET GLOBAL innodb_buffer_pool_size=8388608;
ERROR HY000: innodb_buffer_pool_size change aborted
SELECT @@GLOBAL.innodb_adaptive_hash_index,@@GLOBAL.innodb_buffer_pool_size;
@@GLOBAL.innodb_adaptive_hash_index @@GLOBAL.innodb_buffer_pool_size
1 16777216
SET GLOBAL innodb_adaptive_hash_index = @old_innodb_adaptive_hash_index;
CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 SELECT seq FROM seq_1_to_200;
SET GLOBAL innodb_max_purge_lag_wait=0;

View File

@@ -581,4 +581,20 @@ WHERE variable_name = 'innodb_bulk_operations';
bulk_operations
1
DROP TABLE t1;
call mtr.add_suppression("Found 1 prepared XA transactions");
#
# MDEV-36771 Assertion `bulk_insert == TRX_NO_BULK' failed
# in trx_t::assert_freed from innodb_shutdown
#
CREATE TABLE t1(f1 INT)ENGINE=InnoDB;
XA START 'a';
INSERT INTO t1 VALUES(1);
XA END 'a';
XA PREPARE 'a';
# restart
XA COMMIT 'a';
SELECT * FROM t1;
f1
1
DROP TABLE t1;
# End of 10.11 tests

View File

@@ -0,0 +1,2 @@
--innodb_sort_buffer_size=64k
--innodb_rollback_on_timeout=1

View File

@@ -0,0 +1,55 @@
--source include/have_innodb.inc
--source include/have_sequence.inc
--source include/have_debug.inc
--echo #
--echo # MDEV-36017 Alter table aborts when temporary
--echo # directory is full
--echo #
SET SESSION DEFAULT_STORAGE_ENGINE=InnoDB;
CREATE TABLE t1(f1 CHAR(100) NOT NULL, f2 CHAR(100) NOT NULL,
f3 CHAR(100) NOT NULL, f4 CHAR(100) NOT NULL,
f5 CHAR(100) NOT NULL)ENGINE=InnoDB;
INSERT INTO t1 SELECT 'a', 'b', 'c', 'd', 'e' FROM seq_1_to_65536;
--error ER_GET_ERRMSG
SET STATEMENT DEBUG_DBUG="+d,write_to_tmp_file_fail" FOR
CREATE TABLE t2 as SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL, f2 CHAR(100),
f3 CHAR(100))ENGINE=InnoDB;
INSERT INTO t1 SELECT seq, 'a', 'b' FROM seq_1_to_1024;
--error ER_GET_ERRMSG
SET STATEMENT DEBUG_DBUG="+d,write_to_tmp_file_fail" FOR
ALTER TABLE t1 FORCE, ALGORITHM=COPY;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL, f2 CHAR(100),
f3 CHAR(100))ENGINE=InnoDB;
INSERT INTO t1 SELECT seq, 'a', 'b' FROM seq_1_to_4096;
SET DEBUG_SYNC="inplace_after_index_build SIGNAL dml_start WAIT_FOR dml_commit";
SEND ALTER TABLE t1 ADD KEY(f1), ADD INDEX(f3(10));
connect(con1,localhost,root,,,);
SET DEBUG_SYNC="now WAIT_FOR dml_start";
BEGIN;
INSERT INTO t1 SELECT * FROM t1;
SET STATEMENT DEBUG_DBUG="+d,os_file_write_fail" FOR COMMIT;
SET DEBUG_SYNC="now SIGNAL dml_commit";
connection default;
--error ER_TEMP_FILE_WRITE_FAILURE
reap;
disconnect con1;
CHECK TABLE t1;
DROP TABLE t1;
SET STATEMENT DEBUG_DBUG="+d,ddl_log_write_fail" FOR
CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB;
DROP TABLE t1;
CREATE TABLE t1(f1 TEXT, index(f1(2)))ENGINE=InnoDB;
INSERT INTO t1 VALUES('a');
--error ER_RECORD_FILE_FULL
set statement DEBUG_DBUG="+d,btr_page_alloc_fail" for
UPDATE t1 set f1= REPEAT('b', 12000);
DROP TABLE t1;

View File

@@ -0,0 +1 @@
--innodb_sort_buffer_size=64k

View File

@@ -0,0 +1,30 @@
--source include/have_innodb.inc
--source include/have_sequence.inc
--source include/have_debug.inc
--echo #
--echo # MDEV-36017 Alter table aborts when temporary
--echo # directory is full
--echo #
CREATE TABLE t1(f1 INT NOT NULL, f2 CHAR(100),
f3 CHAR(100))ENGINE=InnoDB;
INSERT INTO t1 SELECT seq, 'a', 'b' FROM seq_1_to_4096;
SET DEBUG_SYNC="inplace_after_index_build SIGNAL dml_start WAIT_FOR dml_commit";
SEND ALTER TABLE t1 ADD KEY(f1), ADD INDEX(f3(10));
connect(con1,localhost,root,,,);
SET DEBUG_SYNC="now WAIT_FOR dml_start";
BEGIN;
INSERT INTO t1 SELECT * FROM t1;
SET STATEMENT DEBUG_DBUG="+d,os_file_write_fail" FOR COMMIT;
SET DEBUG_SYNC="now SIGNAL dml_commit";
connection default;
--error ER_TEMP_FILE_WRITE_FAILURE
reap;
disconnect con1;
CHECK TABLE t1;
DROP TABLE t1;
SET STATEMENT DEBUG_DBUG="+d,ddl_log_write_fail" FOR
CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB;
DROP TABLE t1;

View File

@@ -1,5 +1,6 @@
--source include/have_innodb.inc
--source include/have_sequence.inc
--source include/not_embedded.inc # there are no messages in mysqld.1.err
--echo #
--echo # MDEV-29445: Reorganize buffer pool (and remove chunks)
@@ -42,6 +43,17 @@ INSERT INTO t2 SELECT seq*4,seq*4 FROM seq_1_to_16384;
SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
--enable_query_log
SELECT @@GLOBAL.innodb_adaptive_hash_index;
--error 0,ER_WRONG_USAGE
SET STATEMENT max_statement_time=1e-9 FOR
SET GLOBAL innodb_buffer_pool_size = 7340032;
SELECT @@GLOBAL.innodb_adaptive_hash_index;
--let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err
--let SEARCH_PATTERN= InnoDB: Trying to shrink innodb_buffer_pool_size=7m
--let SEARCH_PATTERN= innodb_buffer_pool_size=7m.*resized from|innodb_buffer_pool_size change aborted
--source include/search_pattern_in_file.inc
# Attempt to shrink the buffer pool. This may occasionally fail.
--error 0,ER_WRONG_USAGE
set global innodb_buffer_pool_size = 7340032;

View File

@@ -8,6 +8,16 @@ SET @save_size=@@GLOBAL.innodb_buffer_pool_size;
SET GLOBAL innodb_limit_optimistic_insert_debug=2;
SET GLOBAL innodb_buffer_pool_size=16777216;
call mtr.add_suppression("innodb_buffer_pool_size change aborted");
SET @old_innodb_adaptive_hash_index = @@innodb_adaptive_hash_index;
SET GLOBAL innodb_adaptive_hash_index = ON;
--error ER_WRONG_USAGE
SET STATEMENT debug_dbug='+d,buf_shrink_fail' FOR
SET GLOBAL innodb_buffer_pool_size=8388608;
SELECT @@GLOBAL.innodb_adaptive_hash_index,@@GLOBAL.innodb_buffer_pool_size;
SET GLOBAL innodb_adaptive_hash_index = @old_innodb_adaptive_hash_index;
CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 SELECT seq FROM seq_1_to_200;

View File

@@ -635,4 +635,19 @@ SELECT variable_value-@old_bulk_op bulk_operations
FROM information_schema.global_status
WHERE variable_name = 'innodb_bulk_operations';
DROP TABLE t1;
call mtr.add_suppression("Found 1 prepared XA transactions");
--echo #
--echo # MDEV-36771 Assertion `bulk_insert == TRX_NO_BULK' failed
--echo # in trx_t::assert_freed from innodb_shutdown
--echo #
CREATE TABLE t1(f1 INT)ENGINE=InnoDB;
XA START 'a';
INSERT INTO t1 VALUES(1);
XA END 'a';
XA PREPARE 'a';
--source include/restart_mysqld.inc
XA COMMIT 'a';
SELECT * FROM t1;
DROP TABLE t1;
--echo # End of 10.11 tests