Project

General

Profile

Actions

Bug #1213

closed

mysql.inc SQLupdate does not handle NULL correctly

Added by Anchi Cheng over 13 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
03/01/2011
Due date:
% Done:

0%

Estimated time:
Affected Version:
Appion/Leginon 2.1.0
Show in known bugs:
No
Workaround:

Description

The query built from it would not update the table field to NULL but give 0.

Actions #1

Updated by Anchi Cheng over 13 years ago

  • 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.

Actions #2

Updated by Eric Hou over 13 years ago

  • Status changed from In Code Review to In Test
  • Assignee changed from Eric Hou to Amber Herold

code looks good.
ready for test.

Actions #3

Updated by Amber Herold over 13 years ago

  • Assignee changed from Amber Herold to Jim Pulokas
Actions #4

Updated by Amber Herold over 12 years ago

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?

Actions #5

Updated by Jim Pulokas over 12 years ago

  • Status changed from In Test to Closed

yes, should be well tested by now.

Actions

Also available in: Atom PDF