mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-22413 Server hangs upon UPDATE on a view reading from versioned partitioned table
UPDATE gets access to history records because versioning conditions
are not set for VIEW. This leads to endless loop of inserting history
records when clustered index is rebuilt and ha_rnd_next() returns
newly inserted history record.
Return back original behavior of failing on write-locked table in
historical query.
35b679b9
assumed that SELECT_LEX::lock_type influences anything, but
actually at this point table is already locked. Original bug report
was tempesta-tech/mariadb#102
This commit is contained in:
@ -832,10 +832,16 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
|
||||
|
||||
if (vers_conditions.is_set())
|
||||
{
|
||||
if (vers_conditions.was_set() &&
|
||||
table->lock_type > TL_READ_NO_INSERT &&
|
||||
!vers_conditions.delete_history)
|
||||
{
|
||||
my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0), table->alias.str);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
if (vers_conditions.type == SYSTEM_TIME_ALL)
|
||||
continue;
|
||||
|
||||
lock_type= TL_READ; // ignore TL_WRITE, history is immutable anyway
|
||||
}
|
||||
|
||||
const LEX_CSTRING *fstart=
|
||||
|
Reference in New Issue
Block a user