Bug #5068 Views: WITH CHECK OPTION doesn't work
Submitted: 16 Aug 2004 23:29 Modified: 19 Aug 2004 18:08
Reporter: Trudy Pelzer Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:MySQL version = 5.0.2-alpha-debug OS:OS = SuSE 8.2
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[16 Aug 2004 23:29] Trudy Pelzer
Description:
MySQL doesn't store "WITH CHECK OPTION"
for "CREATE VIEW ... WITH CHECK OPTION".
So when the view's definition is violated, the
bad data is accepted; although it doesn't
show in the view, it does appear in the underlying
table.

It also won't store INTO clauses, or FOR UPDATE
clauses, but they are less important.

How to repeat:
create table t1 (col1 int) engine=innodb;
create view vt1 as select col1 from t1 where col1 > 0 with check option;
show create view vt1;
insert into vt1 values (10);
insert into vt1 values (-10);
select * from t1;
select * from vt1;

create view v2t1 as select * into @a from t1;
show create view v2t1;
create view v2t1 as select col1 from t1 for update;
show create view v2t1;
[19 Aug 2004 18:08] Oleksandr Byelkin
Thank you for bugreport, but "WITH CHECK OPTION" and "cascade" in DROP VIEW 
included only to pass syntax construction and are not implemented ye (will be soon)