Merge pull request #33535 from kssenii/fix-local-client-exception

Fix clickhouse local interactive exception case
This commit is contained in:
tavplubix 2022-01-12 13:17:05 +03:00 committed by GitHub
commit 8c9a369588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 0 deletions

View File

@ -214,6 +214,12 @@ bool LocalConnection::poll(size_t)
if (next_packet_type)
return true;
if (state->exception)
{
next_packet_type = Protocol::Server::Exception;
return true;
}
if (!state->is_finished)
{
if (send_progress && (state->after_send_progress.elapsedMicroseconds() >= query_context->getSettingsRef().interactive_delay))

View File

@ -0,0 +1,21 @@
#!/usr/bin/expect -f
log_user 0
set timeout 20
match_max 100000
expect_after {
eof { exp_continue }
timeout { exit 1 }
}
set basedir [file dirname $argv0]
spawn bash -c "source $basedir/../shell_config.sh ; \$CLICKHOUSE_LOCAL --disable_suggestion"
expect ":) "
send -- "insert into table function null() format TSV some trash here 123 \n 456\r"
expect -re ".*DB::Exception: Table function 'null' requires 'structure'.*\r"
expect ":) "
send -- ""
expect eof