diff --git a/clickhouse/client.cpp b/clickhouse/client.cpp index 36c1bcb3..209f70c1 100644 --- a/clickhouse/client.cpp +++ b/clickhouse/client.cpp @@ -34,8 +34,9 @@ #define DBMS_MIN_REVISION_WITH_SERVER_DISPLAY_NAME 54372 #define DBMS_MIN_REVISION_WITH_VERSION_PATCH 54401 #define DBMS_MIN_REVISION_WITH_LOW_CARDINALITY_TYPE 54405 +#define DBMS_MIN_REVISION_WITH_COLUMN_DEFAULTS_METADATA 54410 -#define REVISION DBMS_MIN_REVISION_WITH_LOW_CARDINALITY_TYPE +#define REVISION DBMS_MIN_REVISION_WITH_COLUMN_DEFAULTS_METADATA namespace clickhouse { @@ -430,6 +431,19 @@ bool Client::Impl::ReceivePacket(uint64_t* server_packet) { return false; } + case ServerCodes::TableColumns: { + // external table name + if (!WireFormat::SkipString(*input_)) { + return false; + } + + // columns metadata + if (!WireFormat::SkipString(*input_)) { + return false; + } + return true; + } + default: throw UnimplementedError("unimplemented " + std::to_string((int)packet_type)); break; diff --git a/clickhouse/protocol.h b/clickhouse/protocol.h index dc51f32a..47a76534 100644 --- a/clickhouse/protocol.h +++ b/clickhouse/protocol.h @@ -16,6 +16,7 @@ namespace clickhouse { Extremes = 8, /// Block of mins and maxs, may be compressed. TablesStatusResponse = 9, /// Response to TableStatus. Log = 10, /// Query execution log. + TableColumns = 11, /// Columns' description for default values calculation }; } @@ -23,7 +24,7 @@ namespace clickhouse { namespace ClientCodes { enum { Hello = 0, /// Name, version, default database name. - Query = 1, /** Query id, query settings, query processing stage, + Query = 1, /** Query id, query settings, query processing stage, * compression status, and query text (no INSERT data). */ Data = 2, /// Data `Block` (e.g. INSERT data), may be compressed. @@ -32,7 +33,7 @@ namespace clickhouse { }; } - /// Should we compress `Block`s of data + /// Should we compress `Block`s of data namespace CompressionState { enum { Disable = 0,