mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
inserting single value with check option failed always get error (part of BUG#5995)
This commit is contained in:
@ -1535,3 +1535,15 @@ insert into v2 values (0);
|
|||||||
ERROR HY000: CHECK OPTION failed 'test.v2'
|
ERROR HY000: CHECK OPTION failed 'test.v2'
|
||||||
drop view v2, v1;
|
drop view v2, v1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 (s1 int);
|
||||||
|
create view v1 as select * from t1 where s1 < 5 with check option;
|
||||||
|
insert ignore into v1 values (6);
|
||||||
|
ERROR HY000: CHECK OPTION failed 'test.v1'
|
||||||
|
insert ignore into v1 values (6),(3);
|
||||||
|
Warnings:
|
||||||
|
Error 1369 CHECK OPTION failed 'test.v1'
|
||||||
|
select * from t1;
|
||||||
|
s1
|
||||||
|
3
|
||||||
|
drop view v1;
|
||||||
|
drop table t1;
|
||||||
|
@ -1482,3 +1482,18 @@ create view v2 as select * from v1 with cascaded check option;
|
|||||||
insert into v2 values (0);
|
insert into v2 values (0);
|
||||||
drop view v2, v1;
|
drop view v2, v1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# inserting single value with check option failed always get error
|
||||||
|
#
|
||||||
|
create table t1 (s1 int);
|
||||||
|
create view v1 as select * from t1 where s1 < 5 with check option;
|
||||||
|
#single value
|
||||||
|
-- error 1369
|
||||||
|
insert ignore into v1 values (6);
|
||||||
|
#several values
|
||||||
|
insert ignore into v1 values (6),(3);
|
||||||
|
select * from t1;
|
||||||
|
drop view v1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
@ -319,7 +319,10 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((res= table_list->view_check_option(thd, ignore_err)) ==
|
if ((res= table_list->view_check_option(thd,
|
||||||
|
(values_list.elements == 1 ?
|
||||||
|
0 :
|
||||||
|
ignore_err))) ==
|
||||||
VIEW_CHECK_SKIP)
|
VIEW_CHECK_SKIP)
|
||||||
continue;
|
continue;
|
||||||
else if (res == VIEW_CHECK_ERROR)
|
else if (res == VIEW_CHECK_ERROR)
|
||||||
|
Reference in New Issue
Block a user