diff --git a/lib/core/agent.py b/lib/core/agent.py index 774e3cf3d..dae2c4226 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -434,11 +434,14 @@ class Agent: @rtype: C{str} """ - if not unpack: - return query - else: - concatenatedQuery = query + if unpack: + concatenatedQuery = "" + query = query.replace(", ", ",") fieldsSelectFrom, fieldsSelect, fieldsNoSelect, fieldsSelectTop, fieldsSelectCase, _, fieldsToCastStr, fieldsExists = self.getFields(query) + castedFields = self.nullCastConcatFields(fieldsToCastStr) + concatenatedQuery = query.replace(fieldsToCastStr, castedFields, 1) + else: + return query if Backend.getIdentifiedDbms() == DBMS.MYSQL: if fieldsExists: