massive BUG FIX (if NULL is one of dumping values it will screw everything in corner cases because "SELECT 1 WHERE NULL IN (NULL)" and "SELECT 1 WHERE NULL NOT IN (NULL)" will always return nothing/nadda/zero/not even NULL)

This commit is contained in:
Miroslav Stampar 2011-03-20 23:54:56 +00:00
parent 9b1f2d82d0
commit 3ca5cddca7

View File

@ -677,10 +677,10 @@ class Agent:
if " WHERE " in limitedQuery:
limitedQuery = "%s AND %s " % (limitedQuery, uniqueField)
else:
limitedQuery = "%s WHERE %s " % (limitedQuery, uniqueField)
limitedQuery = "%s WHERE ISNULL(%s,' ') " % (limitedQuery, uniqueField)
limitedQuery += "NOT IN (%s" % (limitStr % num)
limitedQuery += "%s %s ORDER BY %s) ORDER BY %s" % (uniqueField, fromFrom, uniqueField, uniqueField)
limitedQuery += "ISNULL(%s,' ') %s ORDER BY %s) ORDER BY %s" % (uniqueField, fromFrom, uniqueField, uniqueField)
else:
if " WHERE " in limitedQuery:
limitedQuery = "%s AND %s " % (limitedQuery, field)