Bug #1213
closed
mysql.inc SQLupdate does not handle NULL correctly
Added by Anchi Cheng over 13 years ago.
Updated over 12 years ago.
Affected Version:
Appion/Leginon 2.1.0
Description
The query built from it would not update the table field to NULL but give 0.
- Status changed from Assigned to In Code Review
- Assignee changed from Anchi Cheng to Eric Hou
r15456 fixed this. I've checked places where SQLUpdate is used and did not find any places that will cause an accidental NULL insertion since in all cases the field that are not changed are not included as a key in the $data that goes into SQLUpdate.
test:
1. Negative test, for example, addgroup.php uses the function. If the description is updated to empty string, it should not turn into NULL in leginondb.GroupData table.
2. Positive test in which NULL is inserted, myamiweb/project/updatesample.php is the only place that it is used now when the package assignment of a sample is changed to the weird NULL. Since this is not used at NRAMM, it is hard to test. But the SQLUpdate function is general.
Eric, please assign to Jim to test if you don't want to make a table for nsample just for this.
- Status changed from In Code Review to In Test
- Assignee changed from Eric Hou to Amber Herold
code looks good.
ready for test.
- Assignee changed from Amber Herold to Jim Pulokas
Jim, do you think we can close this out now since the code has been in place for so long, or is there a test that you would like to do for it?
- Status changed from In Test to Closed
yes, should be well tested by now.
Also available in: Atom
PDF