diff --git a/src/DIRAC/Core/Utilities/MySQL.py b/src/DIRAC/Core/Utilities/MySQL.py index 171f66058db..40fb2a5602b 100755 --- a/src/DIRAC/Core/Utilities/MySQL.py +++ b/src/DIRAC/Core/Utilities/MySQL.py @@ -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: