At 20:10 -0800 3/13/04, Andrew Zhu wrote:
Mysql 4.0.12 on win xp.

Question: is the check constraint supported?

Example:
create table temp (
c1 varchar (50) check (c1 like "[EMAIL PROTECTED]")
);

insert into temp values ("whatever");

will succeed. Is my constraint wrong (say to check the
email address)? or this is just parsed without
enforcement?

The latter:


http://www.mysql.com/doc/en/CREATE_TABLE.html

In MySQL Version 3.23.44 or later, InnoDB tables support checking of
foreign key constraints. See section 15 The InnoDB Storage Engine. Note
that the FOREIGN KEY syntax in InnoDB is more restrictive than the syntax
presented above: The columns of the referenced table must always be
explicitly named.  InnoDB supports both ON DELETE and ON UPDATE actions
on foreign keys as of MySQL 3.23.50 and 4.0.8, respectively. See the
InnoDB manual section for the precise syntax. See section 15.6.4 FOREIGN
KEY Constraints. For other storage engines, MySQL Server does parse the
FOREIGN KEY and REFERENCES syntax in CREATE TABLE commands, but without
further action being taken. The CHECK clause is parsed and ignored for
all storage engines.  See section 1.8.5.5 Foreign Keys.

--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

MySQL Users Conference: April 14-16, 2004
http://www.mysql.com/uc2004/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to