Skip to content

Commit

Permalink
Add extra packet types in receive_* methods according to server side …
Browse files Browse the repository at this point in the history
…possible packet types
  • Loading branch information
insomnes committed Oct 13, 2023
1 parent 7bb9a63 commit a771321
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions clickhouse_driver/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,15 +698,18 @@ def receive_end_of_insert_query(self):
if packet.type == ServerPacketTypes.END_OF_STREAM:
break

elif packet.type == ServerPacketTypes.EXCEPTION:
raise packet.exception

elif packet.type == ServerPacketTypes.LOG:
log_block(packet.block)

elif packet.type == ServerPacketTypes.PROGRESS:
continue

elif packet.type == ServerPacketTypes.EXCEPTION:
raise packet.exception

else:
message = self.connection.unexpected_packet_message(
'Exception, EndOfStream or Log', packet.type
'EndOfStream, Log, Progress or Exception', packet.type
)
raise errors.UnexpectedPacketFromServerError(message)

Expand All @@ -727,12 +730,15 @@ def receive_profile_events(self):
elif packet.type == ServerPacketTypes.PROGRESS:
self.last_query.store_progress(packet.progress)

elif packet.type == ServerPacketTypes.LOG:
log_block(packet.block)

elif packet.type == ServerPacketTypes.EXCEPTION:
raise packet.exception

else:
message = self.connection.unexpected_packet_message(
'ProfileEvent, Progress or Exception', packet.type
'ProfileEvents, Progress, Log or Exception', packet.type
)
raise errors.UnexpectedPacketFromServerError(message)

Expand Down

0 comments on commit a771321

Please sign in to comment.