1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +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:
Aleksey Midenkov
2020-05-28 22:22:19 +03:00
parent 3e9b96b6ff
commit dd9773b723
7 changed files with 67 additions and 13 deletions

View File

@ -206,8 +206,7 @@ ERROR HY000: Table `t1` is not system-versioned
create or replace table t1 (x int) with system versioning;
insert into t1 values (1);
select * from t1 for system_time all for update;
x
1
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
create or replace table t1 (a int not null auto_increment primary key) with system versioning;
select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1;
a