Freebsd and macos fixes

This commit is contained in:
proller 2017-06-15 22:39:35 +03:00
parent 6be261e131
commit 4c7dd6ff8b
2 changed files with 10 additions and 2 deletions

View File

@ -2,7 +2,9 @@
#include <iostream>
#include <limits>
#include <regex>
#include <sys/sysinfo.h>
#if __has_include(<sys/sysinfo.h>)
#include <sys/sysinfo.h>
#endif
#include <unistd.h>
#include <boost/program_options.hpp>
@ -45,6 +47,7 @@ namespace ErrorCodes
extern const int POCO_EXCEPTION;
extern const int STD_EXCEPTION;
extern const int UNKNOWN_EXCEPTION;
extern const int NOT_IMPLEMENTED;
}
static String pad(size_t padding) {
@ -670,6 +673,7 @@ private:
if (precondition == "ram_size")
{
#if __has_include(<sys/sysinfo.h>)
struct sysinfo *system_information = new struct sysinfo();
if (sysinfo(system_information))
{
@ -687,6 +691,9 @@ private:
return false;
}
}
#else
throw DB::Exception("Not implemented", ErrorCodes::NOT_IMPLEMENTED);
#endif
}
if (precondition == "table_exists")

View File

@ -10,6 +10,7 @@
#include <ext/range.h>
#include <common/logger_useful.h>
#include <Core/Names.h>
#include <memory>
namespace DB
{
@ -338,7 +339,7 @@ ColumnPtr DictionaryBlockInputStream<DictionaryType, Key>::getColumnFromStringAt
const Columns & keys, const DataTypes & data_types,
const DictionaryAttribute& attribute, const DictionaryType& dictionary) const
{
auto column_string = std::make_unique<ColumnString>();
auto column_string = std::make_shared<ColumnString>();
auto ptr = column_string.get();
callGetter(getter, ids, keys, data_types, ptr, attribute, dictionary);
return column_string;