Error 'Incorrect integer value' when inserting an empty string into INT field in MySQL 5.7
-
@Tom-Elliott You are absolutely right! It works when adding new entries but would fail on updating. So the fix will be a lot more complex I suppose.
Should we try to just get this fixed for MySQL 5.7’s stricter sql_mode options (like converting empty string to zero for integer fields) or shall we really do a complete DB restructure for 1.3.0 I wonder?!?
-
@Sebastian-Roth I think fixing, for now, the issue as presented. Seeing as the 2.0 code will be more adaptable and forgiving than the current, and we’ve been nearly 2 years out since a stable release was last pushed, I think fixing the issues at hand would be the “quickest”, but it’s still “dirty”.
I think a restructure would be beneficial but could add substantial extra time to the release of 1.3.0.
-
@Sebastian-Roth Unfortunately I have already installed Centos7 as it’s rather busy and we kind of rely on FOG, but if I have some time I could get a VM going.
-
I’ve added code that should set the sql_mode to unstrict for FOG’s session within the DB. This “should” allow the fields to be empty even if it’s expecting an int. I don’t like having to make config changes all because of one version, but from what I can tell, this is the simplest way. I don’t know if it will work so testing and reporting will still be needed (as normal).
Thanks.
-
Worked on my 16.04 test VM (beside the ‘‘settingKey’’ fix still missing). Anyone else?
-
@Sebastian-Roth settingKey fix should be in the latest. Yep, that means you’re already out of date
-
So, is it safe to solve the thread, or should I wait for others having this issue report back – after they update of course?
-
I’m marking this solved. Please feel free to open this again if we run into the issue again.