1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

rpl: check should go after defaults and vcols update

This commit is contained in:
Nikita Malyavin
2022-09-28 10:01:07 +03:00
committed by Sergei Golubchik
parent aa1a2507f5
commit da5df33927
3 changed files with 75 additions and 13 deletions

View File

@ -864,9 +864,11 @@ insert t1 values (1),(2),(3),(4);
set debug_sync= 'now wait_for downgraded';
connection con2;
set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
alter table t1 add b int default(a+10), algorithm=copy, lock=none;
alter table t1 add b int default(a), algorithm=copy, lock=none;
connection default;
update t1 set a=a+10 where a > 2;
insert t1 values(5);
update t1 set a=a+10 where a = 5;
set debug_sync= 'now signal goforit';
connection con2;
connection default;
@ -874,14 +876,45 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT (`a` + 10)
`b` int(11) DEFAULT `a`
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
select * from t1;
a b
1 11
2 12
13 23
14 24
1 1
2 2
13 13
14 14
15 15
drop table t1;
set debug_sync= 'reset';
## VCOL + CHECK
create table t1 (a int) engine=innodb;
insert t1 values (1),(2),(3),(4);
set debug_sync= 'now wait_for downgraded';
connection con2;
set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
alter table t1 add b int as (a), add check(b=a), algorithm=copy, lock=none;
connection default;
update t1 set a=a+10 where a > 2;
insert t1 values(5);
update t1 set a=a+10 where a = 5;
set debug_sync= 'now signal goforit';
connection con2;
connection default;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL,
CONSTRAINT `CONSTRAINT_1` CHECK (`b` = `a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
select * from t1;
a b
1 1
2 2
13 13
14 14
15 15
drop table t1;
set debug_sync= 'reset';
#