use tryReadQuotedStringInto

This commit is contained in:
hendrik-m 2023-08-03 21:10:53 +02:00
parent 921b1eecb5
commit 72e6b1d2d4
2 changed files with 2 additions and 7 deletions

View File

@ -251,12 +251,7 @@ bool ParserTableAsStringLiteralIdentifier::parseImpl(Pos & pos, ASTPtr & node, E
ReadBufferFromMemory in(pos->begin, pos->size());
String s;
try
{
readQuotedStringWithSQLStyle(s, in);
}
catch (const Exception &)
{
if (!tryReadQuotedStringInto(s, in)) {
expected.add(pos, "string literal");
return false;
}

View File

@ -46,7 +46,7 @@ $CLICKHOUSE_LOCAL -q "SELECT * FROM '${dir}/tmp.csv'"
#################
echo "Test 3a: check literal no parsing overflow"
$CLICKHOUSE_LOCAL -q "SELECT * FROM '${dir}/tmp.csv''bad'" 2>&1 | grep -c "UNKNOWN_TABLE"
$CLICKHOUSE_LOCAL -q "SELECT * FROM '${dir}/tmp.csv''bad'" 2>&1 | grep -c "SYNTAX_ERROR"
#################
echo "Test 3b: check literal empty"