diff --git a/dbms/include/DB/Columns/ColumnAggregateFunction.h b/dbms/include/DB/Columns/ColumnAggregateFunction.h index d42c72c9ac3..41f41dc04b0 100644 --- a/dbms/include/DB/Columns/ColumnAggregateFunction.h +++ b/dbms/include/DB/Columns/ColumnAggregateFunction.h @@ -85,7 +85,7 @@ public: ~ColumnAggregateFunction() { - if (!func->hasTrivialDestructor() && src) + if (!func->hasTrivialDestructor() && !src) for (auto val : data) func->destroy(val); } diff --git a/dbms/include/DB/IO/CompressedReadBufferBase.h b/dbms/include/DB/IO/CompressedReadBufferBase.h index 2a7893712dc..86367bb8625 100644 --- a/dbms/include/DB/IO/CompressedReadBufferBase.h +++ b/dbms/include/DB/IO/CompressedReadBufferBase.h @@ -42,7 +42,7 @@ protected: char * compressed_buffer = nullptr; #ifdef USE_QUICKLZ - qlz_state_decompress * qlz_state = nullptr; + std::unique_ptr qlz_state; #else void * fixed_size_padding = nullptr; #endif @@ -122,7 +122,7 @@ protected: { #ifdef USE_QUICKLZ if (!qlz_state) - qlz_state = new qlz_state_decompress; + qlz_state = std::make_unique(); qlz_decompress(&compressed_buffer[0], to, qlz_state); #else @@ -154,14 +154,6 @@ public: { } - ~CompressedReadBufferBase() - { - #ifdef USE_QUICKLZ - if (qlz_state) - delete qlz_state; - #endif - } - /** Не проверять чексуммы. * Может использоваться, например, в тех случаях, когда сжатые данные пишет клиент, * который не умеет вычислять чексуммы, и вместо этого заполняет их нулями или чем угодно. diff --git a/dbms/include/DB/Parsers/ASTQueryWithOutput.h b/dbms/include/DB/Parsers/ASTQueryWithOutput.h index 3a0bb4eac0f..c3325e59fad 100644 --- a/dbms/include/DB/Parsers/ASTQueryWithOutput.h +++ b/dbms/include/DB/Parsers/ASTQueryWithOutput.h @@ -34,15 +34,14 @@ public: \ \ ASTPtr clone() const override \ { \ - Name * res = new Name(*this); \ - ASTPtr ptr{res}; \ + std::shared_ptr res = std::make_shared(*this); \ res->children.clear(); \ if (format) \ { \ res->format = format->clone(); \ res->children.push_back(res->format); \ } \ - return ptr; \ + return res; \ } \ \ protected: \ diff --git a/dbms/include/DB/Parsers/ASTQueryWithTableAndOutput.h b/dbms/include/DB/Parsers/ASTQueryWithTableAndOutput.h index d99025593d0..91e5ccae9d5 100644 --- a/dbms/include/DB/Parsers/ASTQueryWithTableAndOutput.h +++ b/dbms/include/DB/Parsers/ASTQueryWithTableAndOutput.h @@ -46,15 +46,14 @@ protected: \ ASTPtr clone() const override \ { \ - Name * res = new Name(*this); \ - ASTPtr ptr{res}; \ + std::shared_ptr res = std::make_shared(*this); \ res->children.clear(); \ if (format) \ { \ res->format = format->clone(); \ res->children.push_back(res->format); \ } \ - return ptr; \ + return res; \ } \ \ protected: \ diff --git a/dbms/src/Client/MultiplexedConnections.cpp b/dbms/src/Client/MultiplexedConnections.cpp index c55f8167432..ee42e6be86c 100644 --- a/dbms/src/Client/MultiplexedConnections.cpp +++ b/dbms/src/Client/MultiplexedConnections.cpp @@ -63,7 +63,7 @@ MultiplexedConnections::MultiplexedConnections(ConnectionPools & pools_, const S for (auto & pool : pools_) { - if (pool) + if (!pool) throw Exception("Invalid pool specified", ErrorCodes::LOGICAL_ERROR); initFromShard(pool.get()); } diff --git a/dbms/src/Common/ConfigProcessor.cpp b/dbms/src/Common/ConfigProcessor.cpp index f7cf7cdded4..15a59fcf75e 100644 --- a/dbms/src/Common/ConfigProcessor.cpp +++ b/dbms/src/Common/ConfigProcessor.cpp @@ -40,9 +40,8 @@ ConfigProcessor::ConfigProcessor(bool throw_on_bad_incl_, bool log_to_console, c { if (log_to_console && Logger::has("ConfigProcessor") == nullptr) { - Poco::Channel * channel = new Poco::ConsoleChannel; - channel_ptr = channel; - log = &Logger::create("ConfigProcessor", channel, Poco::Message::PRIO_TRACE); + channel_ptr = new Poco::ConsoleChannel; + log = &Logger::create("ConfigProcessor", channel_ptr.get(), Poco::Message::PRIO_TRACE); } else { diff --git a/dbms/src/Interpreters/ExternalDictionaries.cpp b/dbms/src/Interpreters/ExternalDictionaries.cpp index cff3122c215..f5d067a9c50 100644 --- a/dbms/src/Interpreters/ExternalDictionaries.cpp +++ b/dbms/src/Interpreters/ExternalDictionaries.cpp @@ -212,8 +212,7 @@ void ExternalDictionaries::reloadFromFile(const std::string & config_path, const /// definitions of dictionaries may have changed, recreate all of them config_last_modified = last_modified; - const auto config = new Poco::Util::XMLConfiguration{config_path}; - SCOPE_EXIT(config->release()); + Poco::AutoPtr config = new Poco::Util::XMLConfiguration(config_path); /// get all dictionaries' definitions Poco::Util::AbstractConfiguration::Keys keys; diff --git a/dbms/src/Server/config.xml b/dbms/src/Server/config.xml index 62d889f4058..66f4475a0be 100644 --- a/dbms/src/Server/config.xml +++ b/dbms/src/Server/config.xml @@ -14,7 +14,7 @@ (important for some administration scripts). --> 1000M - 2 + 10 diff --git a/debian/copy_clang_binaries.sh b/debian/copy_clang_binaries.sh index 870a48cc149..da4d40799ce 100755 --- a/debian/copy_clang_binaries.sh +++ b/debian/copy_clang_binaries.sh @@ -6,7 +6,7 @@ DST=${1:-.}; PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:$PATH" CLANG=$(command -v clang) -LD=$(command -v ld) +LD=$(command -v gold || command -v ld.gold || command -v ld) if [ ! -x "$CLANG" ]; then echo "Not found executable clang." @@ -14,12 +14,12 @@ if [ ! -x "$CLANG" ]; then fi if [ ! -x "$LD" ]; then - echo "Not found executable ld." + echo "Not found executable gold or ld." exit 1 fi cp "$CLANG" $DST -cp "$LD" $DST +cp "$LD" ${DST}/ld STDCPP=$(ldd $(command -v clang) | grep -oE '/[^ ]+libstdc++[^ ]+') diff --git a/debian/rules b/debian/rules index b8d38748f17..26f009b9643 100755 --- a/debian/rules +++ b/debian/rules @@ -153,7 +153,7 @@ binary-arch: build install dh_compress dh_fixperms dh_installdeb - dh_shlibdeps --exclude=clang --exclude=stdc + dh_shlibdeps --exclude=clang --exclude=stdc --exclude=ld dh_gencontrol dh_md5sums dh_builddeb -- -z3 diff --git a/doc/build.md b/doc/build.md index 8cd15b99702..10ecb010b62 100644 --- a/doc/build.md +++ b/doc/build.md @@ -3,7 +3,12 @@ Build should work on Linux Ubuntu 12.04, 14.04 or newer. With appropriate changes, build should work on any other Linux distribution. Build is not intended to work on Mac OS X. -Only x86_64 is supported. Support for AArch64 is experimental. +Only x86_64 with SSE 4.2 is supported. Support for AArch64 is experimental. + +To test for SSE 4.2, do +``` +grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported" +``` ## Install Git and CMake diff --git a/doc/google419fbd824d7ff97d.html b/doc/google419fbd824d7ff97d.html new file mode 100644 index 00000000000..b7e25cf48cc --- /dev/null +++ b/doc/google419fbd824d7ff97d.html @@ -0,0 +1 @@ +google-site-verification: google419fbd824d7ff97d.html \ No newline at end of file diff --git a/doc/habrahabr/2/clickmap.png b/doc/habrahabr/2/clickmap.png new file mode 100644 index 00000000000..728aeeac6d9 Binary files /dev/null and b/doc/habrahabr/2/clickmap.png differ diff --git a/doc/index.html b/doc/index.html index b9b780b6c1f..c25d862574e 100644 --- a/doc/index.html +++ b/doc/index.html @@ -386,7 +386,7 @@

Download

-

System requirements: Linux, x86_64.

+

System requirements: Linux, x86_64 with SSE 4.2.

Install packages for Ubuntu 14.04 (Trusty) or Ubuntu 12.04 (Precise):

diff --git a/doc/logo.svg b/doc/logo.svg new file mode 100644 index 00000000000..70662da887e --- /dev/null +++ b/doc/logo.svg @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/doc/reference_en.html b/doc/reference_en.html index d97d3604e49..a974216a6af 100644 --- a/doc/reference_en.html +++ b/doc/reference_en.html @@ -361,7 +361,10 @@ At this time (May 2016), there aren't any available open-source and free sys

System requirements

-

This is not a cross-platform system. It requires Linux Ubuntu Precise (12.04) or newer, with x86_64 architecture. +

This is not a cross-platform system. It requires Linux Ubuntu Precise (12.04) or newer, x86_64 architecture with SSE 4.2 instruction set. +To test for SSE 4.2 support, do +grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported" + We recommend using Ubuntu Trusty or Ubuntu Precise. The terminal must use UTF-8 encoding (the default in Ubuntu).

diff --git a/doc/reference_ru.html b/doc/reference_ru.html index f368fe124ad..fd7716f1729 100644 --- a/doc/reference_ru.html +++ b/doc/reference_ru.html @@ -386,7 +386,10 @@ OLAPServer хорошо подходил для неагрегированных

Системные требования

-

Система некроссплатформенная. Требуется ОС Linux Ubuntu не более старая, чем Precise (12.04); архитектура x86_64. +

Система некроссплатформенная. Требуется ОС Linux Ubuntu не более старая, чем Precise (12.04); архитектура x86_64 с поддержкой набора инструкций SSE 4.2. +Для проверки наличия SSE 4.2, выполните: +grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported" + Рекомендуется использовать Ubuntu Trusty или Ubuntu Precise. Терминал должен работать в кодировке UTF-8 (как по умолчанию в Ubuntu).

diff --git a/doc/robots.txt b/doc/robots.txt new file mode 100644 index 00000000000..c2a49f4fb82 --- /dev/null +++ b/doc/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Allow: / diff --git a/private b/private index a482f9ec80b..bc91114b009 160000 --- a/private +++ b/private @@ -1 +1 @@ -Subproject commit a482f9ec80b4c10e92b3d647b3558978cc453d2e +Subproject commit bc91114b009ca3edde1a00dcf9d355388f6e9899 diff --git a/tools/init.d/template b/tools/init.d/template index 6163c7e006b..3468cc4bd97 100755 --- a/tools/init.d/template +++ b/tools/init.d/template @@ -26,6 +26,14 @@ NUMBER_OF_PROCESSES=$DEFAULT_NUMBER_OF_PROCESSES LOG_FILE="" +# On x86_64, check for required instruction set. +if uname -mpi | grep -q x86_64; then + if ! grep -q sse4_2 /proc/cpuinfo; then + echo 'SSE 4.2 instruction set is not supported' + exit 3 + fi +fi + # С помощью xmlstarlet пытаемся взять некоторые параметры из конфига if command -v xmlstarlet >/dev/null 2>&1; then NUMBER_OF_PROCESSES=$(xmlstarlet sel -t -v "/yandex/number_of_processes" $CNFFILE || echo $DEFAULT_NUMBER_OF_PROCESSES)