Couple of patches related to the #3473

This commit is contained in:
Miroslav Stampar
2019-02-07 16:45:16 +01:00
parent 5b0d25ff25
commit 5eb9f5729c
4 changed files with 14 additions and 7 deletions

View File

@@ -631,9 +631,11 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
dataToStdout(filterControlChars(val))
# some DBMSes (e.g. Firebird, DB2, etc.) have issues with trailing spaces
if len(partialValue) > INFERENCE_BLANK_BREAK and partialValue[-INFERENCE_BLANK_BREAK:].isspace() and partialValue.strip(' ')[-1:] != '\n':
if len(partialValue) > INFERENCE_BLANK_BREAK and partialValue[-INFERENCE_BLANK_BREAK:].isspace():
finalValue = partialValue[:-INFERENCE_BLANK_BREAK]
break
elif charsetType and partialValue[-1:].isspace():
break
if (lastChar > 0 and index >= lastChar):
finalValue = "" if length == 0 else partialValue