diff --git a/lib/core/agent.py b/lib/core/agent.py index 4c272739e..143657685 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -450,7 +450,7 @@ class Agent: else: return query - if Backend.getIdentifiedDbms() == DBMS.MYSQL: + if Backend.isDbms(DBMS.MYSQL): if fieldsExists: concatenatedQuery = concatenatedQuery.replace("SELECT ", "CONCAT('%s'," % kb.misc.start, 1) concatenatedQuery += ",'%s')" % kb.misc.stop diff --git a/lib/core/common.py b/lib/core/common.py index c5e0635c5..473a7a981 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -421,11 +421,19 @@ class Backend: # Comparison methods @staticmethod def isDbms(dbms): - return Backend.getDbms() is not None and Backend.getDbms() == aliasToDbmsEnum(dbms) + if Backend.getDbms() is not None: + return Backend.getDbms() == aliasToDbmsEnum(dbms) + else: + return Backend.getIdentifiedDbms() == aliasToDbmsEnum(dbms) @staticmethod def isDbmsWithin(aliases): - return Backend.getDbms() is not None and Backend.getDbms().lower() in aliases + if Backend.getDbms() is not None: + return Backend.getDbms().lower() in aliases + elif Backend.getIdentifiedDbms() is not None: + return Backend.getIdentifiedDbms().lower() in aliases + else: + return False @staticmethod def isVersion(version):