fixed bug for issue #1336

This commit is contained in:
root 2022-10-04 12:21:32 -07:00 committed by Yong Wang
parent 119312091c
commit d8eef2e7f2

View File

@ -534,6 +534,12 @@ bool SubString::convertImpl(String & out,IParser::Pos & pos)
{ {
++pos; ++pos;
auto length = getConvertedArgument(fn_name, pos); auto length = getConvertedArgument(fn_name, pos);
if(startingIndex.empty())
return false;
else if(startingIndex[0] == '-')
out = "substr("+ source + ", " + startingIndex + ", " + length + ")";
else
out = "substr("+ source + ", " + startingIndex + " + 1, " + length + ")"; out = "substr("+ source + ", " + startingIndex + " + 1, " + length + ")";
} }
else else