Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
MySQL Mode: convertInsertNullToZero should be turned off by default? #1942
On a real mysql, when insert a null value into a not null column, it will fail. However, h2 mysql mode does allow this happen by default. AFAIK h2 converts the null into zero by default.
I wonder why convertInsertNullToZero is turned on by default? I thought it should match the mysql behavior.
I saw a similar case here, but did not get really answered:
This compatibility code was written a long time ago when MySQL was very different from others. MySQL got a STRICT mode that disables different legacy tricks. It was enabled by default some time ago:
There is no normal way to toggle
I'm not sure what to do with it. Because default behavior of MySQL was changed in 2015 we may want to remove this flag and all related code now for better compatibility with default behavior of modern versions. But somebody may still use this trick, of course.