MySql, InnoDB & Null Values
Posted
by pws5068
on Stack Overflow
See other posts from Stack Overflow
or by pws5068
Published on 2010-06-06T00:19:22Z
Indexed on
2010/06/06
0:22 UTC
Read the original article
Hit count: 579
Formerly I was using MyISAM storage engine for MySql and I had defined the combination of three fields to be unique.
Now I have switched to InnoDB, which I assume caused this problem, and now NULL != NULL.
So for the following table:
ID (Auto) | Field_A | Field_B | Field_C
I can insert (Field_A,Field_B,Field_C) Values(1,2,NULL) (1,2,NULL) (1,2,NULL) infinitely many times.
How can I prevent this behavior?
© Stack Overflow or respective owner