Receive a part of the result, or progress info or an exception and process it. Returns true if one should continue receiving packets. Output of result is suppressed if query was cancelled.
| 1587 | /// Returns true if one should continue receiving packets. |
| 1588 | /// Output of result is suppressed if query was cancelled. |
| 1589 | bool ClientBase::receiveAndProcessPacket(ASTPtr parsed_query, bool cancelled_) |
| 1590 | { |
| 1591 | Packet packet = connection->receivePacket(); |
| 1592 | |
| 1593 | switch (packet.type) |
| 1594 | { |
| 1595 | case Protocol::Server::Data: |
| 1596 | if (!cancelled_) |
| 1597 | onData(packet.block, parsed_query); |
| 1598 | return true; |
| 1599 | |
| 1600 | case Protocol::Server::Progress: |
| 1601 | onProgress(packet.progress); |
| 1602 | return true; |
| 1603 | |
| 1604 | case Protocol::Server::ProfileInfo: |
| 1605 | onProfileInfo(packet.profile_info); |
| 1606 | return true; |
| 1607 | |
| 1608 | case Protocol::Server::Totals: |
| 1609 | if (!cancelled_) |
| 1610 | onTotals(packet.block, parsed_query); |
| 1611 | return true; |
| 1612 | |
| 1613 | case Protocol::Server::Extremes: |
| 1614 | if (!cancelled_) |
| 1615 | onExtremes(packet.block, parsed_query); |
| 1616 | return true; |
| 1617 | |
| 1618 | case Protocol::Server::Exception: |
| 1619 | onReceiveExceptionFromServer(std::move(packet.exception)); |
| 1620 | return false; |
| 1621 | |
| 1622 | case Protocol::Server::Log: |
| 1623 | onLogData(packet.block); |
| 1624 | return true; |
| 1625 | |
| 1626 | case Protocol::Server::EndOfStream: |
| 1627 | onEndOfStream(); |
| 1628 | return false; |
| 1629 | |
| 1630 | case Protocol::Server::ProfileEvents: |
| 1631 | onProfileEvents(packet.block); |
| 1632 | return true; |
| 1633 | |
| 1634 | case Protocol::Server::TimezoneUpdate: |
| 1635 | onTimezoneUpdate(packet.server_timezone); |
| 1636 | return true; |
| 1637 | |
| 1638 | default: |
| 1639 | throw Exception( |
| 1640 | ErrorCodes::UNKNOWN_PACKET_FROM_SERVER, "Unknown packet {} from server {}", packet.type, connection->getDescription()); |
| 1641 | } |
| 1642 | } |
| 1643 | |
| 1644 | |
| 1645 | void ClientBase::onProgress(const Progress & value) |
nothing calls this directly
no test coverage detected