Skip to content

Commit

Permalink
Merge pull request #5052 from fstagni/v7r2-NULL
Browse files Browse the repository at this point in the history
[v7r2] Added IS NULL mySql condition
  • Loading branch information
Andrei Tsaregorodtsev authored Mar 30, 2021
2 parents a753e2f + 742cf7c commit a7f5e1a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/DIRAC/Core/Utilities/MySQL.py
Original file line number Diff line number Diff line change
Expand Up @@ -1117,10 +1117,15 @@ def buildCondition(self, condDict=None, older=None, newer=None,
attrName,
escapeInValue)
else:
condition = ' %s %s %s = %s' % (condition,
conjunction,
attrName,
escapeInValue)
if escapeInValue == 'NULL':
condition = ' %s %s %s IS NULL' % (condition,
conjunction,
attrName)
else:
condition = ' %s %s %s = %s' % (condition,
conjunction,
attrName,
escapeInValue)
conjunction = "AND"

if timeStamp:
Expand Down

0 comments on commit a7f5e1a

Please sign in to comment.