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

Merge branch '10.6' into '10.11'

This commit is contained in:
Julius Goryavsky
2025-04-15 21:40:26 +02:00
130 changed files with 1586 additions and 110 deletions

View File

@@ -155,7 +155,6 @@ INSERT INTO parent SET a=0;
FLUSH TABLES;
# restart
disconnect incomplete;
SET @save_stats_persistent = @@GLOBAL.innodb_stats_persistent;
SET GLOBAL innodb_stats_persistent = 0;
INSERT INTO child SET a=0;
INSERT INTO child SET a=1;
@@ -1182,6 +1181,25 @@ ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fail
ALTER TABLE t2 ADD KEY(b), ALGORITHM=NOCOPY;
DELETE FROM t1;
DROP TABLE t2, t1;
#
# MDEV-33167 ASAN errors after failing to load foreign key
# relation for the table
#
call mtr.add_suppression("InnoDB: Load table `test`.`t3` failed, the table has missing foreign key indexes. Turn off 'foreign_key_checks' and try again.");
SET STATEMENT FOREIGN_KEY_CHECKS = 0 FOR
CREATE TABLE t1(f1 VARCHAR(8),
FOREIGN KEY(f1) REFERENCES test.t3(f1))ENGINE=InnoDB;
SET STATEMENT FOREIGN_KEY_CHECKS = 0 FOR
CREATE TABLE t2(f1 VARCHAR(8),
FOREIGN KEY(f1) REFERENCES test.t3(f1))
ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
SET STATEMENT FOREIGN_KEY_CHECKS = 0 FOR
CREATE TABLE t3(f1 VARCHAR(8) PRIMARY KEY)
ENGINE=InnoDB DEFAULT CHARSET=latin1;
set GLOBAL innodb_fast_shutdown=0;
# restart
ALTER TABLE t2 FORCE;
DROP TABLE t2, t1, t3;
# End of 10.6 tests
CREATE TABLE t1
(
@@ -1204,5 +1222,4 @@ ALTER TABLE t2 ADD FOREIGN KEY (f2) REFERENCES t2 (f2),
ADD UNIQUE INDEX(f3);
ERROR HY000: Cannot delete rows from table which is parent in a foreign key constraint 't1_ibfk_1' of table 't1'
drop table t1, t2;
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
# End of 10.11 tests

View File

@@ -1,10 +1,11 @@
SET @save_innodb_timeout=@@innodb_lock_wait_timeout;
SET GLOBAL innodb_lock_wait_timeout=1;
set session transaction isolation level read committed;
create table innodb_bug52663 (what varchar(5), id integer, count integer, primary key
(what, id)) engine=innodb;
insert into innodb_bug52663 values ('total', 0, 0);
begin;
connect addconroot, localhost, root,,;
connection addconroot;
set session transaction isolation level read committed;
begin;
connection default;
@@ -31,3 +32,4 @@ select * from innodb_bug52663;
what id count
total 0 2
drop table innodb_bug52663;
SET GLOBAL innodb_lock_wait_timeout=@save_innodb_timeout;

View File

@@ -1,8 +1,9 @@
@@ -527,6 +527,6 @@
@@ -576,7 +576,7 @@
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
instants
-37
+38
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
# End of 10.6 tests
CREATE TABLE t1(f1 INT, f2 TEXT)ENGINE=InnoDB;
INSERT INTO t1 VALUES(1, 'a');
ALTER TABLE t1 ADD COLUMN f3 TEXT FIRST;

View File

@@ -575,5 +575,16 @@ FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
instants
37
CREATE TABLE t1(f1 INT, f2 TEXT)ENGINE=InnoDB;
INSERT INTO t1 VALUES(1, 'a');
ALTER TABLE t1 ADD COLUMN f3 TEXT FIRST;
SET STATEMENT DEBUG_DBUG="+d,instant_insert_fail" FOR
ALTER TABLE t1 DROP COLUMN f1;
ERROR HY000: Internal error: InnoDB: Insert into SYS_COLUMNS failed
ALTER TABLE t1 DROP COLUMN f1;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
# End of 10.6 tests

View File

@@ -133,7 +133,6 @@ FLUSH TABLES;
--let $shutdown_timeout=
disconnect incomplete;
SET @save_stats_persistent = @@GLOBAL.innodb_stats_persistent;
SET GLOBAL innodb_stats_persistent = 0;
INSERT INTO child SET a=0;
@@ -1245,6 +1244,33 @@ ALTER TABLE t2 ADD KEY(b), ALGORITHM=NOCOPY;
DELETE FROM t1;
DROP TABLE t2, t1;
--echo #
--echo # MDEV-33167 ASAN errors after failing to load foreign key
--echo # relation for the table
--echo #
call mtr.add_suppression("InnoDB: Load table `test`.`t3` failed, the table has missing foreign key indexes. Turn off 'foreign_key_checks' and try again.");
SET STATEMENT FOREIGN_KEY_CHECKS = 0 FOR
CREATE TABLE t1(f1 VARCHAR(8),
FOREIGN KEY(f1) REFERENCES test.t3(f1))ENGINE=InnoDB;
SET STATEMENT FOREIGN_KEY_CHECKS = 0 FOR
CREATE TABLE t2(f1 VARCHAR(8),
FOREIGN KEY(f1) REFERENCES test.t3(f1))
ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
SET STATEMENT FOREIGN_KEY_CHECKS = 0 FOR
CREATE TABLE t3(f1 VARCHAR(8) PRIMARY KEY)
ENGINE=InnoDB DEFAULT CHARSET=latin1;
set GLOBAL innodb_fast_shutdown=0;
--let $shutdown_timeout=
--source include/restart_mysqld.inc
# Error encountered while loading the foreign key
# constraint for t3. t1 wasn't loaded into memory yet
# t2 failed to find index for foreign key relation
ALTER TABLE t2 FORCE;
DROP TABLE t2, t1, t3;
--echo # End of 10.6 tests
CREATE TABLE t1
@@ -1270,7 +1296,5 @@ ALTER TABLE t1 ADD FOREIGN KEY (f1) REFERENCES t2 (f2);
ALTER TABLE t2 ADD FOREIGN KEY (f2) REFERENCES t2 (f2),
ADD UNIQUE INDEX(f3);
drop table t1, t2;
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
--echo # End of 10.11 tests
--source include/wait_until_count_sessions.inc

View File

@@ -1,6 +1,7 @@
--source include/long_test.inc
--source include/have_innodb.inc
SET @save_innodb_timeout=@@innodb_lock_wait_timeout;
SET GLOBAL innodb_lock_wait_timeout=1;
set session transaction isolation level read committed;
create table innodb_bug52663 (what varchar(5), id integer, count integer, primary key
@@ -9,7 +10,6 @@ insert into innodb_bug52663 values ('total', 0, 0);
begin;
connect (addconroot, localhost, root,,);
connection addconroot;
set session transaction isolation level read committed;
begin;
@@ -33,3 +33,4 @@ select * from innodb_bug52663;
connection default;
select * from innodb_bug52663;
drop table innodb_bug52663;
SET GLOBAL innodb_lock_wait_timeout=@save_innodb_timeout;

View File

@@ -657,11 +657,19 @@ DROP TABLE t1;
SET DEBUG_SYNC=RESET;
--echo # End of 10.5 tests
SELECT variable_value-@old_instant instants
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
CREATE TABLE t1(f1 INT, f2 TEXT)ENGINE=InnoDB;
INSERT INTO t1 VALUES(1, 'a');
ALTER TABLE t1 ADD COLUMN f3 TEXT FIRST;
--error ER_INTERNAL_ERROR
SET STATEMENT DEBUG_DBUG="+d,instant_insert_fail" FOR
ALTER TABLE t1 DROP COLUMN f1;
ALTER TABLE t1 DROP COLUMN f1;
CHECK TABLE t1;
DROP TABLE t1;
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
--echo # End of 10.6 tests