mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Now send_logs_level won't affect catching exception. Test added.
This commit is contained in:
parent
4b7f5f20c1
commit
4bd79c47dc
@ -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;
|
||||
}
|
||||
|
@ -0,0 +1 @@
|
||||
Got exception on client.
|
12
dbms/tests/queries/0_stateless/00995_exception_while_insert.sh
Executable file
12
dbms/tests/queries/0_stateless/00995_exception_while_insert.sh
Executable 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;"
|
Loading…
Reference in New Issue
Block a user