39
39
#define DBMS_MIN_REVISION_WITH_SETTINGS_SERIALIZED_AS_STRINGS 54429
40
40
#define DBMS_MIN_REVISION_WITH_INTERSERVER_SECRET 54441
41
41
#define DBMS_MIN_REVISION_WITH_OPENTELEMETRY 54442
42
+ #define DBMS_MIN_REVISION_WITH_DISTRIBUTED_DEPTH 54448
43
+ #define DBMS_MIN_REVISION_WITH_INITIAL_QUERY_START_TIME 54449
44
+ #define DBMS_MIN_REVISION_WITH_INCREMENTAL_PROFILE_EVENTS 54451
42
45
43
- #define REVISION DBMS_MIN_REVISION_WITH_OPENTELEMETRY
46
+ #define REVISION DBMS_MIN_REVISION_WITH_INCREMENTAL_PROFILE_EVENTS
44
47
45
48
namespace clickhouse {
46
49
@@ -476,6 +479,22 @@ bool Client::Impl::ReceivePacket(uint64_t* server_packet) {
476
479
return true ;
477
480
}
478
481
482
+ case ServerCodes::ProfileEvents: {
483
+ if (!WireFormat::SkipString (*input_)) {
484
+ return false ;
485
+ }
486
+
487
+ Block block;
488
+ if (!ReadBlock (*input_, &block)) {
489
+ return false ;
490
+ }
491
+
492
+ if (events_) {
493
+ events_->OnProfileEvents (block);
494
+ }
495
+ return true ;
496
+ }
497
+
479
498
default :
480
499
throw UnimplementedError (" unimplemented " + std::to_string ((int )packet_type));
481
500
break ;
@@ -649,6 +668,9 @@ void Client::Impl::SendQuery(const Query& query) {
649
668
WireFormat::WriteString (*output_, info.initial_user );
650
669
WireFormat::WriteString (*output_, info.initial_query_id );
651
670
WireFormat::WriteString (*output_, info.initial_address );
671
+ if (server_info_.revision >= DBMS_MIN_REVISION_WITH_INITIAL_QUERY_START_TIME) {
672
+ WireFormat::WriteFixed<int64_t >(*output_, 0 );
673
+ }
652
674
WireFormat::WriteFixed (*output_, info.iface_type );
653
675
654
676
WireFormat::WriteString (*output_, info.os_user );
@@ -660,6 +682,8 @@ void Client::Impl::SendQuery(const Query& query) {
660
682
661
683
if (server_info_.revision >= DBMS_MIN_REVISION_WITH_QUOTA_KEY_IN_CLIENT_INFO)
662
684
WireFormat::WriteString (*output_, info.quota_key );
685
+ if (server_info_.revision >= DBMS_MIN_REVISION_WITH_DISTRIBUTED_DEPTH)
686
+ WireFormat::WriteUInt64 (*output_, 0u );
663
687
if (server_info_.revision >= DBMS_MIN_REVISION_WITH_VERSION_PATCH) {
664
688
WireFormat::WriteUInt64 (*output_, info.client_version_patch );
665
689
}
0 commit comments