| 1 |
source include/big_test.inc; |
| 2 |
source suite/versioning/engines.inc; |
| 3 |
source suite/versioning/common.inc; |
| 4 |
source include/have_partition.inc; |
| 5 |
|
| 6 |
--echo # |
| 7 |
--echo # MDEV-15458 Segfault in heap_scan() upon UPDATE after ADD SYSTEM VERSIONING |
| 8 |
--echo # |
| 9 |
create or replace table t1 (a int); |
| 10 |
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8); |
| 11 |
insert into t1 select * from t1; |
| 12 |
insert into t1 select * from t1; |
| 13 |
insert into t1 select * from t1; |
| 14 |
insert into t1 select * from t1; |
| 15 |
insert into t1 select * from t1; |
| 16 |
insert into t1 select * from t1; |
| 17 |
insert into t1 select * from t1; |
| 18 |
insert into t1 select * from t1; |
| 19 |
insert into t1 select * from t1; |
| 20 |
|
| 21 |
--connect (con1,localhost,root,,test) |
| 22 |
alter table t1 add system versioning; |
| 23 |
|
| 24 |
--connection default |
| 25 |
update t1 set a= 7 where a = 3; |
| 26 |
update t1 set a= 2 where a = 7; |
| 27 |
update t1 set a= 5 where a = 2; |
| 28 |
update t1 set a= 1 where a = 5; |
| 29 |
update t1 set a= 8 where a = 1; |
| 30 |
update t1 set a= 4 where a = 8; |
| 31 |
update t1 set a= 6; |
| 32 |
|
| 33 |
--disconnect con1 |
| 34 |
drop table t1; |
| 35 |
|
| 36 |
call mtr.add_suppression("need more HISTORY partitions"); |
| 37 |
|
| 38 |
--echo # |
| 39 |
--echo # MDEV-23642 Locking timeout caused by auto-creation affects original DML |
| 40 |
--echo # |
| 41 |
set timestamp= unix_timestamp('2000-01-01 00:00:00'); |
| 42 |
create or replace table t1 (x int primary key) with system versioning engine innodb |
| 43 |
partition by system_time interval 1 hour auto; |
| 44 |
|
| 45 |
insert into t1 values (1); |
| 46 |
start transaction; |
| 47 |
insert into t1 values (2); |
| 48 |
|
| 49 |
--connect con1, localhost, root |
| 50 |
set lock_wait_timeout= 1; |
| 51 |
set innodb_lock_wait_timeout= 1; |
| 52 |
set timestamp= unix_timestamp('2000-01-01 01:00:01'); |
| 53 |
update t1 set x= x + 122 where x = 1; |
| 54 |
--disconnect con1 |
| 55 |
--connection default |
| 56 |
select * from t1; |
| 57 |
|
| 58 |
# cleanup |
| 59 |
drop table t1; |
| 60 |
set timestamp= default; |
| 61 |
|
| 62 |
--echo # |
| 63 |
--echo # MDEV-25339 Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt' failed |
| 64 |
--echo # |
| 65 |
create or replace table t1 (x int) with system versioning engine innodb |
| 66 |
partition by system_time interval 1 hour auto; |
| 67 |
start transaction; |
| 68 |
insert into t1 values (1); |
| 69 |
select * from t1; |
| 70 |
|
| 71 |
--connect con1, localhost, root |
| 72 |
set lock_wait_timeout= 1; |
| 73 |
set innodb_lock_wait_timeout= 1; |
| 74 |
--error ER_LOCK_WAIT_TIMEOUT |
| 75 |
update t1 set x= x + 111; |
| 76 |
select * from t1; |
| 77 |
|
| 78 |
# cleanup |
| 79 |
--disconnect con1 |
| 80 |
--connection default |
| 81 |
drop table t1; |
| 82 |
|
| 83 |
--echo # |
| 84 |
--echo # MDEV-25482 Auto-create: Server hangs after a failed attempt to create partition |
| 85 |
--echo # |
| 86 |
set timestamp= default; |
| 87 |
create table t (pk int primary key, a int) engine=InnoDB |
| 88 |
with system versioning partition by system_time interval 1 hour auto; |
| 89 |
|
| 90 |
insert into t values (1,1),(2,2),(3,3),(4,4),(5,5); |
| 91 |
|
| 92 |
start transaction; |
| 93 |
update t set a= 20 where pk = 2; |
| 94 |
|
| 95 |
--connect (con1,localhost,root,,) |
| 96 |
set lock_wait_timeout= 1; |
| 97 |
set @@timestamp= @@timestamp+3601; |
| 98 |
update t set a= 40 where pk = 4; |
| 99 |
update t set a= 400 where pk = 4; |
| 100 |
|
| 101 |
# Cleanup |
| 102 |
--disconnect con1 |
| 103 |
--connection default |
| 104 |
select * from t where pk = 4; |
| 105 |
rollback; |
| 106 |
drop tables t; |
| 107 |
|
| 108 |
source suite/versioning/common_finish.inc; |