mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-22277 LeakSanitizer: detected memory leaks in mem_heap_create_block_func after attempt to create foreign key
- During online DDL, prepare phase error handler fails to remove the memory allocated for newly created foreign keys.
This commit is contained in:
@ -233,3 +233,14 @@ Opened_table_definitions 2
|
||||
Opened_tables 2
|
||||
drop function foo;
|
||||
drop table t2, t1;
|
||||
CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY (pk)) ENGINE=InnoDB;
|
||||
XA START 'xid';
|
||||
INSERT INTO t1 VALUES (1,2);
|
||||
CREATE TABLE x AS SELECT * FROM t1;
|
||||
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
|
||||
SET foreign_key_checks= OFF, innodb_lock_wait_timeout= 1;
|
||||
ALTER TABLE t1 ADD FOREIGN KEY f (a) REFERENCES t1 (pk), LOCK=EXCLUSIVE;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
XA END 'xid';
|
||||
XA ROLLBACK 'xid';
|
||||
DROP TABLE t1;
|
||||
|
@ -285,6 +285,20 @@ show status like '%opened_tab%';
|
||||
drop function foo;
|
||||
drop table t2, t1;
|
||||
|
||||
CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY (pk)) ENGINE=InnoDB;
|
||||
XA START 'xid';
|
||||
INSERT INTO t1 VALUES (1,2);
|
||||
--error ER_XAER_RMFAIL
|
||||
CREATE TABLE x AS SELECT * FROM t1;
|
||||
--connect (con1,localhost,root,,test)
|
||||
SET foreign_key_checks= OFF, innodb_lock_wait_timeout= 1;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
ALTER TABLE t1 ADD FOREIGN KEY f (a) REFERENCES t1 (pk), LOCK=EXCLUSIVE;# Cleanup
|
||||
--disconnect con1
|
||||
--connection default
|
||||
XA END 'xid';
|
||||
XA ROLLBACK 'xid';
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.1 tests
|
||||
#
|
||||
|
Reference in New Issue
Block a user