fix wrong defaults at columns tail and some build fixes

This commit is contained in:
chertus 2018-07-16 22:28:07 +03:00
parent 0463fb6dd3
commit 07a782e637
5 changed files with 4 additions and 15 deletions

View File

@ -1,9 +1,5 @@
option (ENABLE_CAPNP "Enable Cap'n Proto" ${NOT_MSVC})
unset (USE_CAPNP CACHE)
unset (USE_INTERNAL_CAPNP_LIBRARY CACHE)
unset (MISSING_INTERNAL_CAPNP_LIBRARY CACHE)
if (ENABLE_CAPNP)
# cmake 3.5.1 bug:
# capnproto uses this cmake feature:

View File

@ -16,6 +16,7 @@
#include <common/readline_use.h>
#include <common/find_first_symbols.h>
#include <common/SetTerminalEcho.h>
#include <Common/config.h>
#include <Common/ClickHouseRevision.h>
#include <Common/Stopwatch.h>
#include <Common/Exception.h>

View File

@ -74,7 +74,7 @@ Block AddingDefaultsBlockInputStream::readImpl()
for (size_t row_idx = 0; row_idx < column_read.column->size(); ++row_idx)
{
if (defaults_mask[row_idx])
if (row_idx < defaults_mask.size() && defaults_mask[row_idx])
{
if (column_def.column->isColumnConst())
column_mixed->insert((*column_def.column)[row_idx]);

View File

@ -16,7 +16,6 @@ namespace ErrorCodes
extern const int CANNOT_PARSE_NUMBER;
extern const int CANNOT_PARSE_UUID;
extern const int TOO_LARGE_STRING_SIZE;
extern const int INCORRECT_NUMBER_OF_COLUMNS;
}
@ -62,14 +61,8 @@ Block BlockInputStreamFromRowInputStream::readImpl()
break;
for (size_t column_idx = 0; column_idx < info.read_columns.size(); ++column_idx)
{
if (!info.read_columns[column_idx]) {
size_t column_size = columns[column_idx]->size();
if (column_size == 0)
throw Exception("Unexpected empty column", ErrorCodes::INCORRECT_NUMBER_OF_COLUMNS);
delayed_defaults.setBit(column_idx, column_size - 1);
}
}
if (!info.read_columns[column_idx])
delayed_defaults.setBit(column_idx, rows);
}
catch (Exception & e)
{

View File

@ -4,7 +4,6 @@
#cmakedefine01 USE_TCMALLOC
#cmakedefine01 USE_JEMALLOC
#cmakedefine01 USE_CAPNP
#cmakedefine01 USE_READLINE
#cmakedefine01 USE_LIBEDIT
#cmakedefine01 HAVE_READLINE_HISTORY