1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-32586 incorrect error about cyclic reference about JSON type virtual column

remove the hack where NO_DEFAULT_VALUE_FLAG was temporarily removed
from a field to initialize DEFAULT() functions in CHECK constraints
while disabling self-reference field checks.

Instead, initialize DEFAULT() functions in CHECK explicitly,
don't call check_field_expression_processor() for CHECK at all.
This commit is contained in:
Sergei Golubchik
2023-10-26 11:00:26 +02:00
parent 9c43343213
commit c9f87b8813
5 changed files with 35 additions and 10 deletions

View File

@ -308,5 +308,15 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop table t1;
#
# MDEV-32586 incorrect error about cyclic reference about JSON type virtual column
#
create table t1 (a int, b json as (a));
drop table t1;
create table t1 (a int, b int as (a) check (b > 0));
insert t1 (a) values (1);
insert t1 (a) values (-1);
ERROR 23000: CONSTRAINT `t1.b` failed for `test`.`t1`
drop table t1;
#
# End of 10.4 tests
#