mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
MDEV-16713 Hangs server with repeating log entry
At most one transaction can be active at a time for temporary tables. There is no need to check previous version of record for the temporary tables.
This commit is contained in:
parent
969939e89c
commit
de85355436
4 changed files with 39 additions and 0 deletions
|
@ -650,3 +650,16 @@ SELECT * FROM t1;
|
|||
f1
|
||||
0
|
||||
DROP TABLE t1;
|
||||
create procedure t1_proc()
|
||||
begin
|
||||
DECLARE var INT UNSIGNED;
|
||||
CREATE TEMPORARY TABLE t1(f1 INT UNSIGNED, f2 INT UNSIGNED, KEY( f1, f2 ) )engine=innodb;
|
||||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 SET f1 = 1, f2 = 1;
|
||||
UPDATE t1 SET f2 = 2;
|
||||
SET var = ( SELECT 1 FROM t1 );
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
call t1_proc;
|
||||
drop procedure t1_proc;
|
||||
|
|
|
@ -476,3 +476,20 @@ UPDATE t1 SET f1 = 0;
|
|||
ROLLBACK;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
delimiter //;
|
||||
create procedure t1_proc()
|
||||
begin
|
||||
DECLARE var INT UNSIGNED;
|
||||
CREATE TEMPORARY TABLE t1(f1 INT UNSIGNED, f2 INT UNSIGNED, KEY( f1, f2 ) )engine=innodb;
|
||||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 SET f1 = 1, f2 = 1;
|
||||
UPDATE t1 SET f2 = 2;
|
||||
SET var = ( SELECT 1 FROM t1 );
|
||||
DROP TABLE t1;
|
||||
END//
|
||||
delimiter ;//
|
||||
|
||||
call t1_proc;
|
||||
drop procedure t1_proc;
|
||||
|
|
|
@ -5023,6 +5023,13 @@ wrong_offs:
|
|||
if (!rec_get_deleted_flag(rec, comp)) {
|
||||
goto no_gap_lock;
|
||||
}
|
||||
|
||||
/* At most one transaction can be active
|
||||
for temporary table. */
|
||||
if (dict_table_is_temporary(clust_index->table)) {
|
||||
goto no_gap_lock;
|
||||
}
|
||||
|
||||
if (index == clust_index) {
|
||||
trx_id_t trx_id = row_get_rec_trx_id(
|
||||
rec, index, offsets);
|
||||
|
|
|
@ -114,6 +114,8 @@ row_vers_impl_x_locked_low(
|
|||
trx_id = row_get_rec_trx_id(clust_rec, clust_index, clust_offsets);
|
||||
corrupt = FALSE;
|
||||
|
||||
ut_ad(!dict_table_is_temporary(clust_index->table));
|
||||
|
||||
trx_t* trx = trx_rw_is_active(trx_id, &corrupt, true);
|
||||
|
||||
if (trx == 0) {
|
||||
|
|
Loading…
Reference in a new issue