mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-18875 Assertion `thd->transaction.stmt.ha_list == __null || trans == &thd->transaction.stmt' failed or bogus ER_DUP_ENTRY upon ALTER TABLE with versioning
Cause: * when autocommit=0 (or transaction is issued by user), `ha_commit_trans` is called twice on ALTER TABLE, causing a duplicated insert into `transaction_registry` (ER_DUP_ENTRY). Solution: * ALTER TABLE makes an implicit commit by a second call. We actually need to make an insert only when it is a real commit. So is_real variable is additionally checked.
This commit is contained in:
committed by
Marko Mäkelä
parent
808bc919eb
commit
720e9bd5be
@ -476,3 +476,16 @@ SET @@SYSTEM_VERSIONING_ALTER_HISTORY=ERROR;
|
||||
SELECT count(*) from mysql.transaction_registry where begin_timestamp>=commit_timestamp;
|
||||
count(*)
|
||||
0
|
||||
# MDEV-18875 Assertion `thd->transaction.stmt.ha_list == __null ||
|
||||
# trans == &thd->transaction.stmt' failed or bogus ER_DUP_ENTRY upon
|
||||
# ALTER TABLE with versioning
|
||||
create or replace table t (x int) engine=innodb;
|
||||
set autocommit= 0;
|
||||
alter table t
|
||||
algorithm=copy,
|
||||
add column row_start bigint unsigned as row start,
|
||||
add column row_end bigint unsigned as row end,
|
||||
add period for system_time(row_start,row_end),
|
||||
with system versioning;
|
||||
set autocommit= 1;
|
||||
create or replace database test;
|
||||
|
@ -498,3 +498,18 @@ DROP TABLE t;
|
||||
SET @@SYSTEM_VERSIONING_ALTER_HISTORY=ERROR;
|
||||
|
||||
SELECT count(*) from mysql.transaction_registry where begin_timestamp>=commit_timestamp;
|
||||
|
||||
--echo # MDEV-18875 Assertion `thd->transaction.stmt.ha_list == __null ||
|
||||
--echo # trans == &thd->transaction.stmt' failed or bogus ER_DUP_ENTRY upon
|
||||
--echo # ALTER TABLE with versioning
|
||||
create or replace table t (x int) engine=innodb;
|
||||
set autocommit= 0;
|
||||
alter table t
|
||||
algorithm=copy,
|
||||
add column row_start bigint unsigned as row start,
|
||||
add column row_end bigint unsigned as row end,
|
||||
add period for system_time(row_start,row_end),
|
||||
with system versioning;
|
||||
set autocommit= 1;
|
||||
|
||||
create or replace database test;
|
||||
|
Reference in New Issue
Block a user