mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 12:32:04 +00:00
fixed bug for issue #1336
This commit is contained in:
parent
119312091c
commit
d8eef2e7f2
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user