dbms: fixed error with ParserUnsignedInteger (used for tuple element access) [#METR-2944].

This commit is contained in:
Alexey Milovidov 2015-12-21 19:59:21 +03:00
parent 3c0c39e38a
commit 23f8413d74
3 changed files with 4 additions and 2 deletions

View File

@ -351,14 +351,14 @@ bool ParserUnsignedInteger::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & m
UInt64 x = 0;
ReadBuffer in(const_cast<char *>(pos), end - pos, 0);
if (!tryReadIntText(x, in) || in.offset() == 0)
if (!tryReadIntText(x, in) || in.count() == 0)
{
expected = "unsigned integer";
return false;
}
res = x;
pos += in.offset();
pos += in.count();
node = new ASTLiteral(StringRange(begin, pos), res);
return true;
}

View File

@ -0,0 +1 @@
SELECT ('a', 'b').2