backward compatibility

This commit is contained in:
chertus 2018-07-16 14:28:22 +03:00
parent 53f1f4794d
commit 925e4c7dbb
4 changed files with 11 additions and 5 deletions

View File

@ -1,6 +1,6 @@
# This strings autochanged from release_lib.sh:
set(VERSION_DESCRIBE v1.1.54394-testing)
set(VERSION_REVISION 54394)
set(VERSION_DESCRIBE v1.1.54400-testing)
set(VERSION_REVISION 54400)
set(VERSION_GITHASH 875ea0f4eaa3592f1fe628b6a1150d91b04ad574)
# end of autochange

View File

@ -314,7 +314,8 @@ void TCPHandler::processInsertQuery(const Settings & global_settings)
#if USE_CAPNP
/// Send query metadata (column defaults)
if (global_settings.insert_sample_with_metadata &&
if (client_revision >= DBMS_MIN_REVISION_WITH_PROTO_METADATA &&
global_settings.insert_sample_with_metadata &&
query_context.getSettingsRef().insert_sample_with_metadata)
{
Block meta_block = storeContextBlock(query_context);

View File

@ -49,6 +49,7 @@
#define DBMS_MIN_REVISION_WITH_TABLES_STATUS 54226
#define DBMS_MIN_REVISION_WITH_TIME_ZONE_PARAMETER_IN_DATETIME_DATA_TYPE 54337
#define DBMS_MIN_REVISION_WITH_SERVER_DISPLAY_NAME 54372
#define DBMS_MIN_REVISION_WITH_PROTO_METADATA 54400
/// Version of ClickHouse TCP protocol. Set to git tag with latest protocol change.
#define DBMS_TCP_PROTOCOL_VERSION 54226

View File

@ -160,7 +160,11 @@ namespace DB
void loadTableMetadata(const Block & block, TableMetadata & table_meta)
{
const ColumnWithTypeAndName & column = block.getByName(contextColumnName());
loadTableMetadata(column, table_meta);
/// select metadata type by column name
if (block.has(contextColumnName()))
{
const ColumnWithTypeAndName & column = block.getByName(contextColumnName());
loadTableMetadata(column, table_meta);
}
}
}