Now send_logs_level won't affect catching exception. Test added.

This commit is contained in:
Dmitry Rubashkin 2019-08-29 15:36:06 +03:00
parent 4b7f5f20c1
commit 4bd79c47dc
3 changed files with 20 additions and 6 deletions

View File

@ -1026,19 +1026,20 @@ private:
while (true)
{
Block block = async_block_input->read();
/// Check if server send Exception packet
auto packet_type = connection->checkPacket();
/// Check if server send Log packet
if (packet_type && *packet_type == Protocol::Server::Log)
receiveAndProcessPacket();
/// Check if server send Exception packet
packet_type = connection->checkPacket();
if (packet_type && *packet_type == Protocol::Server::Exception)
return;
connection->sendData(block);
processed_rows += block.rows();
/// Check if server send Log packet
packet_type = connection->checkPacket();
if (packet_type && *packet_type == Protocol::Server::Log)
receiveAndProcessPacket();
if (!block)
break;
}

View File

@ -0,0 +1 @@
Got exception on client.

View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CURDIR/../shell_config.sh
$CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS check;"
$CLICKHOUSE_CLIENT --query="CREATE TABLE check (x UInt64, y UInt64 DEFAULT throwIf(x > 10000000)) ENGINE = Memory;"
seq 1 11000000 | $CLICKHOUSE_CLIENT --query="INSERT INTO check(x) FORMAT TSV" 2>&1 | grep -q "Value passed to 'throwIf' function is non zero." && echo "Got exception on client." ||:
$CLICKHOUSE_CLIENT --query="DROP TABLE check;"