fix for that 'Subquery returns more than 1 row'

This commit is contained in:
Miroslav Stampar 2010-10-20 08:50:05 +00:00
parent 82f44989ce
commit dabbcf9e23

View File

@ -348,17 +348,16 @@ def __goError(expression, resumeValue=True):
if output and ( expected is None or ( expected == "int" and output.isdigit() ) ):
return output
if kb.misc.testedDbms != "MySQL":
if kb.dbmsDetected:
_, _, _, _, _, _, fieldToCastStr = agent.getFields(expression)
nulledCastedField = agent.nullAndCastField(fieldToCastStr)
expressionReplaced = expression.replace(fieldToCastStr, nulledCastedField, 1)
expressionUnescaped = unescaper.unescape(expressionReplaced)
else:
expressionUnescaped = unescaper.unescape(expression)
else: #temporary (have to find out what's wrong with that "Subquery with more than 1 row")
expressionUnescaped = unescaper.unescape(expression)
if kb.dbmsDetected:
_, _, _, _, _, _, fieldToCastStr = agent.getFields(expression)
nulledCastedField = agent.nullAndCastField(fieldToCastStr)
if kb.dbms == "MySQL":
nulledCastedField = nulledCastedField.replace("CHAR(10000)", "CHAR(255)") #fix for that 'Subquery returns more than 1 row'
expressionReplaced = expression.replace(fieldToCastStr, nulledCastedField, 1)
expressionUnescaped = unescaper.unescape(expressionReplaced)
else:
expressionUnescaped = unescaper.unescape(expression)
debugMsg = "query: %s" % expressionUnescaped
logger.debug(debugMsg)