CHECK MySQL limitation alternative

According to the MySQL manual, "The CHECK clause is parsed but ignored by all storage engines." Therefore, I know that a simple solution is out of the question, but is there another possible way to achieve the same result? Maybe using triggers or stored procedures? If so, how?

Furthermore, since it is simply โ€œdisassembled,โ€ is it as good as saying to avoid using it because it does not serve the purpose?

Using MySQL 5.5.11 and InnoDB Tables

+8
mysql constraints
source share
2 answers

Take a look at this interesting article.

https://wikis.oracle.com/display/mysql/Triggers#Triggers-EmulatingCheckConstraints

I often use this method.

+5
source share

I am using version 5.5.21 you can use ENUM to check restrictions http://dev.mysql.com/doc/refman/5.0/en/enum.html

+2
source share

All Articles