《beginning sql》里有段话:“MySQL versions prior to 5.0.2 support the constraints mentioned here but don’t enforce them, which somewhat reduces their effectiveness. The code described in the following sections works in MySQL, but when you enter data prohibited by a particular constraint, MySQL won’t reject it as other database systems would. Discussion of constraints and invalid data as they relate to MySQL is beyond the scope of this book. Be sure to check the MySQL product documentation for specific information.”
不知道是不是说的你这种情况。我用5.0.67,好像not null约束也不怎么管用。
【 在 dulang6 (雨) 的大作中提到: 】
: 这样的话我设置NOT NULL还有什么意义?