How does MySQL handle storing ENUM value that doesn't exist?
For example suppose my ENUM is "a", "b", "c" and I try to store "d" how is MySQL supposed to behave? Also from a design perspective is there a correct way of ha开发者_C百科ndling this case? (your program receives "d" fo the above enum)
If you are using strict mode then an error will occur otherwise it will store an empty string with a value of zero.
The correct way to handle this case would be to ensure invalid values never get inserted or use another data type.
精彩评论