Fix clickhouse-local syntax exception

This commit is contained in:
kssenii 2021-10-16 15:18:00 +03:00
parent 6b22fdc55a
commit c79c0526ff
3 changed files with 11 additions and 4 deletions

View File

@ -32,7 +32,6 @@
#include <IO/WriteBufferFromFileDescriptor.h>
#include <IO/ReadHelpers.h>
#include <IO/UseSSL.h>
#include <Parsers/parseQuery.h>
#include <Parsers/IAST.h>
#include <base/ErrorHandlers.h>
#include <Functions/registerFunctions.h>
@ -128,9 +127,8 @@ bool LocalServer::executeMultiQuery(const String & all_queries_text)
}
case MultiQueryProcessingStage::PARSING_EXCEPTION:
{
this_query_end = find_first_symbols<'\n'>(this_query_end, all_queries_end);
this_query_begin = this_query_end; /// It's expected syntax error, skip the line
current_exception.reset();
if (current_exception)
current_exception->rethrow();
continue;
}
case MultiQueryProcessingStage::EXECUTE_QUERY:

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
$CLICKHOUSE_LOCAL --query="SELECT number FROM system.numbers INTO OUTFILE test.native.zst FORMAT Native" 2>&1 | grep -q "Code: 62. DB::Exception: Syntax error: failed at position 48 ('test'): test.native.zst FORMAT Native. Expected string literal." && echo 'OK' || echo 'FAIL' ||: