This blog post has moved. Please find it at:
http://www.mpopp.net/2006/01/emulating-check-constraints-with-views/.
Thursday, January 26, 2006
Subscribe to:
Post Comments (Atom)
This is all about db4free.net and the database systems that it offers. The main focus are practical examples of the new features of MySQL 5 and 6 that should show you how to use them for your advantage in your daily life ;-).
2 comments:
The first case definitely looks like a bug. If you do the same thing with a BETWEEN, it will be rejected.
root@test~> CREATE OR REPLACE VIEW v_checktest AS SELECT id, val FROM checktest WHERE val BETWEEN 1 AND 5 WITH CHECK OPTION;
Query OK, 0 rows affected (0.02 sec)
root@test~> UPDATE v_checktest SET val=6 WHERE id=1;
ERROR 1369 (HY000): CHECK OPTION failed 'test.v_checktest'
The second thing, cascaded is the default, so even if you don't define it, it will still be there, so not a bug on that case.
Thank you - I have filed a bug report about it: http://bugs.mysql.com/bug.php?id=16813
Post a Comment