(expression, expressionFields, expressionFieldsList, num=None, emptyFields=None, suppressOutput=False)
| 225 | return safecharencode(retVal) if kb.safeCharEncode else retVal |
| 226 | |
| 227 | def _errorFields(expression, expressionFields, expressionFieldsList, num=None, emptyFields=None, suppressOutput=False): |
| 228 | values = [] |
| 229 | origExpr = None |
| 230 | |
| 231 | width = getConsoleWidth() |
| 232 | threadData = getCurrentThreadData() |
| 233 | |
| 234 | for field in expressionFieldsList: |
| 235 | output = None |
| 236 | |
| 237 | if field.startswith("ROWNUM "): |
| 238 | continue |
| 239 | |
| 240 | if isinstance(num, int): |
| 241 | origExpr = expression |
| 242 | expression = agent.limitQuery(num, expression, field, expressionFieldsList[0]) |
| 243 | |
| 244 | if "ROWNUM" in expressionFieldsList: |
| 245 | expressionReplaced = expression |
| 246 | else: |
| 247 | expressionReplaced = expression.replace(expressionFields, field, 1) |
| 248 | |
| 249 | output = NULL if emptyFields and field in emptyFields else _oneShotErrorUse(expressionReplaced, field) |
| 250 | |
| 251 | if not kb.threadContinue: |
| 252 | return None |
| 253 | |
| 254 | if not any((suppressOutput, kb.bruteMode)): |
| 255 | if kb.fileReadMode and output and output.strip(): |
| 256 | print() |
| 257 | elif output is not None and not (threadData.resumed and kb.suppressResumeInfo) and not (emptyFields and field in emptyFields): |
| 258 | status = "[%s] [INFO] %s: '%s'" % (time.strftime("%X"), "resumed" if threadData.resumed else "retrieved", output if kb.safeCharEncode else safecharencode(output)) |
| 259 | |
| 260 | if len(status) > width and not conf.noTruncate: |
| 261 | status = "%s..." % status[:width - 3] |
| 262 | |
| 263 | dataToStdout("%s\n" % status) |
| 264 | |
| 265 | if isinstance(num, int): |
| 266 | expression = origExpr |
| 267 | |
| 268 | values.append(output) |
| 269 | |
| 270 | return values |
| 271 | |
| 272 | def _errorReplaceChars(value): |
| 273 | """ |
no test coverage detected
searching dependent graphs…