I have a MYSQL table with a column defined as “INT” with DEFAULT NULL.
And the grid for this column has:
- isnull = true
- editrules: required=false, number=true
Problem:
- When I enter “0”, it gets inserted into the DB as NULL.
So then I changed “isnull” to FALSE. Then “0” gets inserted as 0. Good! But now an empty value gets inserted as “0”.
There must be an obvious fix to this. But I just can’t figure it out. Help please!
Thanks for reporting this issue. We’ll update our build to fix this.
I can see the records that you requested refund due to missing requirements in Nov 2018 and contract was cancelled. After that no new contract is made. To have continued support you should have active contract.
Also, just as a note, it’s illegal to use the paid package after the refund and cause possible legal action.
If you think you have purchased license with some different account, let us know.
Thanks for the quick reply. Wow… I’m surprised this issue was never brought up in the past. Very much looking forward to the update. ETA on the next build? As for the purchased license, I’m currently still evaluating the software (after realizing phpgrid from another vendor wasn’t going to work out). Full intention is to purchase once all of my tests pass. I hope that’s acceptable?
Btw, just to make clarify…. since the refund, I had been using the grid software from phpgrid.com. Our needs have changed and required additional features that were lacking, which is why I started evaluating your grid software again. In fact, I believe the above may be the only outstanding issue remaining. Thank you!
After some research, I come to this conclusion. Mysql does not allow blank string to be stored in not-null integer field. If you try to insert ”, It will be converted to 0 by mysql. There are some alternate ways as well, but they are not in recommended ways.
Ref: https://stackoverflow.com/questions/28606483/how-to-allow-empty-string-for-integer-in-mysql
But in my case, my INT column was defined with “DEFAUT NULL”. It was NOT not-null integer field. So if I leave a cell blank, then it should get saved as NULL or that entering “0” should get saved as 0. But currently:
- When grid is set to isnull = true:
- entering “0” gets inserted into the DB as NULL.
- When isnull = false:
- an empty value gets inserted as “0”.
0’s getting interpreted as NULL and empty value getting interpreted as “0” is a hug bug. I would appreciate your review again. Thank you!
Hi. Any update on this? Anyone else running into this issue? Defining a DB column as “INT DEFAULT NULL”, you’ll get one of two behaviors:
- an empty value gets updated into the DB as “0”
- “0” value gets updated into the DB as NULL
This is a critical bug. Thankfully we were testing on a dev DB. Otherwise, it would have completely corrupted our database. Be aware!
Thanks for reporting and it’s fixed in latest build.