dbms, contrib: GCC 6 build fixes [#METR-20000]

This commit is contained in:
Vladimir Chebotarev 2016-05-23 03:40:28 +03:00
parent 9edd8d0b51
commit 866c8929e2
18 changed files with 53 additions and 23 deletions

View File

@ -47,6 +47,10 @@ POSSIBILITY OF SUCH DAMAGE.
#endif
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Warray-bounds"
#endif
/* This module contains the external function pcre_compile(), along with
supporting internal functions that are not used by other modules. */

View File

@ -22,6 +22,9 @@
#include "Poco/String.h"
#include "Poco/Types.h"
#if __GNUC__ > 5
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
#endif
using Poco::RefCountedObject;
using Poco::NumberFormatter;

View File

@ -11,6 +11,10 @@
#include "util/flags.h"
#include "util/pcre.h"
#if __GNUC__ > 5
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
#endif
#define PCREPORT(level) LOG(level)
// Default PCRE limits.

View File

@ -56,6 +56,10 @@
#include "common.h"
#include "internal_logging.h"
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wunused-function"
#endif
// On systems (like freebsd) that don't define MAP_ANONYMOUS, use the old
// form of the name instead.
#ifndef MAP_ANONYMOUS

View File

@ -18,6 +18,7 @@
#include <vector>
#include <map>
#include <tuple>
#include <random>
namespace DB

View File

@ -6,6 +6,7 @@
#include <DB/IO/WriteHelpers.h>
#include <Poco/Util/AbstractConfiguration.h>
#include <ext/range.hpp>
#include <numeric>
#include <vector>
#include <string>
#include <map>

View File

@ -28,6 +28,7 @@
#include <ext/range.hpp>
#include <unordered_map>
#include <numeric>
namespace DB

View File

@ -544,9 +544,9 @@ public:
+ toString(arguments.size()) + ", should be 1.",
ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
if (!typeid_cast<const DataTypeString *>(&*arguments[0]))
throw Exception("Illegal type " + arguments[0]->getName() + " of first argument of function " + getName() + ". Must be String.",
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
if (!typeid_cast<const DataTypeString *>(&*arguments[0]))
throw Exception("Illegal type " + arguments[0]->getName() + " of first argument of function " + getName() + ". Must be String.",
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
}
void init(Block & block, const ColumnNumbers & arguments) {}
@ -632,9 +632,9 @@ public:
+ toString(arguments.size()) + ", should be 1.",
ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
if (!typeid_cast<const DataTypeString *>(&*arguments[0]))
throw Exception("Illegal type " + arguments[0]->getName() + " of first argument of function " + getName() + ". Must be String.",
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
if (!typeid_cast<const DataTypeString *>(&*arguments[0]))
throw Exception("Illegal type " + arguments[0]->getName() + " of first argument of function " + getName() + ". Must be String.",
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
}
/// Возвращает позицию аргумента, являющегося столбцом строк
@ -712,9 +712,9 @@ public:
+ toString(arguments.size()) + ", should be 1.",
ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
if (!typeid_cast<const DataTypeString *>(&*arguments[0]))
throw Exception("Illegal type " + arguments[0]->getName() + " of first argument of function " + getName() + ". Must be String.",
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
if (!typeid_cast<const DataTypeString *>(&*arguments[0]))
throw Exception("Illegal type " + arguments[0]->getName() + " of first argument of function " + getName() + ". Must be String.",
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
}
void init(Block & block, const ColumnNumbers & arguments) {}
@ -811,9 +811,9 @@ public:
+ toString(arguments.size()) + ", should be 1.",
ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
if (!typeid_cast<const DataTypeString *>(&*arguments[0]))
throw Exception("Illegal type " + arguments[0]->getName() + " of first argument of function " + getName() + ". Must be String.",
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
if (!typeid_cast<const DataTypeString *>(&*arguments[0]))
throw Exception("Illegal type " + arguments[0]->getName() + " of first argument of function " + getName() + ". Must be String.",
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
}
void init(Block & block, const ColumnNumbers & arguments) {}

View File

@ -1,5 +1,6 @@
#pragma once
#include <cmath>
#include <cstring>
#include <limits>
#include <algorithm>

View File

@ -32,7 +32,7 @@ public:
throw Exception(std::string("Cannot dlopen: ") + dlerror());
}
~SharedLibrary()
~SharedLibrary() noexcept(false)
{
if (handle && dlclose(handle))
throw Exception("Cannot dlclose");

View File

@ -1,8 +1,9 @@
#pragma once
#include <string.h>
#include <cstring>
#include <unordered_map>
#include <memory>
#include <random>
#include <Poco/Timespan.h>

View File

@ -1,3 +1,5 @@
#include <numeric>
#include <DB/Interpreters/Context.h>
#include <DB/Interpreters/ExpressionAnalyzer.h>
#include <DB/Interpreters/ExpressionActions.h>

View File

@ -343,7 +343,7 @@ int main(int argc, char ** argv)
data.begin() + (data.size() * i) / num_threads,
data.begin() + (data.size() * (i + 1)) / num_threads));
pool.wait();
pool.wait();
watch.stop();
double time_aggregated = watch.elapsedSeconds();
@ -367,7 +367,8 @@ int main(int argc, char ** argv)
for (auto it = maps[i].begin(); it != maps[i].end(); ++it)
maps[0][it->first] += it->second;
watch.stop();
watch.stop();
double time_merged = watch.elapsedSeconds();
std::cerr
<< "Merged in " << time_merged
@ -531,7 +532,7 @@ int main(int argc, char ** argv)
data.begin() + (data.size() * i) / num_threads,
data.begin() + (data.size() * (i + 1)) / num_threads));
pool.wait();
pool.wait();
watch.stop();
double time_aggregated = watch.elapsedSeconds();
@ -555,7 +556,7 @@ int main(int argc, char ** argv)
pool.schedule(std::bind(merge2,
&maps[0], num_threads, i));
pool.wait();
pool.wait();
watch.stop();
double time_merged = watch.elapsedSeconds();

View File

@ -1,4 +1,5 @@
#include <iomanip>
#include <random>
/*#include <Poco/Mutex.h>
#include <Poco/Ext/ThreadNumber.h>*/

View File

@ -291,10 +291,10 @@ bool SummingSortedBlockInputStream::mergeMap(const MapDescription & desc, Row &
Row right(left.size());
for (size_t col_num : desc.key_col_nums)
right[col_num] = (*cursor->all_columns[col_num])[cursor->pos].get<Array>();
right[col_num] = (*cursor->all_columns[col_num])[cursor->pos].template get<Array>();
for (size_t col_num : desc.val_col_nums)
right[col_num] = (*cursor->all_columns[col_num])[cursor->pos].get<Array>();
right[col_num] = (*cursor->all_columns[col_num])[cursor->pos].template get<Array>();
auto at_ith_column_jth_row = [&](const Row & matrix, size_t i, size_t j) -> const Field &
{

View File

@ -12,6 +12,11 @@
* В gcc 4.9 и clang 3.6 всё Ок.
*/
/// В этом тесте намеренно ссылаемся за пределы массива.
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Warray-bounds"
#endif
typedef unsigned long size_t;
class BufferBase

View File

@ -476,9 +476,9 @@ void ExpressionActions::checkLimits(Block & block) const
if (!block.getByPosition(i).column->isConst())
list_of_non_const_columns << "\n" << block.getByPosition(i).name;
throw Exception("Too many temporary non-const columns:" + list_of_non_const_columns.str()
+ ". Maximum: " + toString(limits.max_temporary_non_const_columns),
ErrorCodes::TOO_MUCH_TEMPORARY_NON_CONST_COLUMNS);
throw Exception("Too many temporary non-const columns:" + list_of_non_const_columns.str()
+ ". Maximum: " + toString(limits.max_temporary_non_const_columns),
ErrorCodes::TOO_MUCH_TEMPORARY_NON_CONST_COLUMNS);
}
}
}

View File

@ -5,6 +5,7 @@
#include <common/logger_useful.h>
#include <DB/Storages/MergeTree/BackgroundProcessingPool.h>
#include <random>
namespace DB
{