1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-10370 Check constraints on virtual columns fails on INSERT when column not specified

add columns needed for CHECK constraints not only to read_set,
but also to vcol_set.
This commit is contained in:
Sergei Golubchik
2017-03-22 18:44:01 +01:00
parent 1216244eb9
commit 33ec445975
3 changed files with 16 additions and 0 deletions

View File

@ -131,3 +131,8 @@ t1 CREATE TABLE `t1` (
CONSTRAINT `CONSTRAINT_2` CHECK (`a` > `b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1(c1 int, c2 int as (c1 + 1), check (c2 > 2));
insert into t1(c1) values(1);
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
insert into t1(c1) values(2);
drop table t1;