Page 1 of 1
does mysql not allow the keyword 'check' ?
Posted: Sun Mar 16, 2003 6:00 am
by lazy_yogi
does mysql not allow the keyword 'check' ?
eg .. this doesnt work
CREATE TABLE ex (
sess char(2) not null check (sess in ('S1','S2','X1','X2'))
);
Posted: Sun Mar 16, 2003 8:54 am
by twigletmac
It depends what table types you are using:
http://www.mysql.com/doc/en/CREATE_TABLE.html
MySQL Manual wrote:In MySQL Version 3.23.44 or later, InnoDB tables support checking of foreign key constraints. See section 7.5 InnoDB Tables. Note that the FOREIGN KEY syntax in InnoDB is more restricted than the syntax presented above. InnoDB does not allow index_name to be specified, and the columns of the referenced table always have to be explicitly named. Starting from 4.0.8 InnoDB supports both ON DELETE and ON UPDATE actions on foreign keys. See the InnoDB manual section for the precise syntax. See section 7.5 InnoDB Tables. For other table types, MySQL Server does parse the FOREIGN KEY, CHECK, and REFERENCES syntax in CREATE TABLE commands, but without further action being taken. See section 1.7.4.5 Foreign Keys.
Mac
Posted: Sun Mar 16, 2003 4:03 pm
by lazy_yogi
MySQL Server does parse the FOREIGN KEY, CHECK, and REFERENCES syntax in CREATE TABLE commands, but without further action being taken.
That's rediculous.
My current version of MySQL does not referential checks on foreitgn keys and doesnt even have syntax for CHECK kewords