Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logical error in codec Delta: value in memory is not of fixed size #12110

Closed
akuzm opened this issue Jul 3, 2020 · 3 comments · Fixed by #12308
Closed

Logical error in codec Delta: value in memory is not of fixed size #12110

akuzm opened this issue Jul 3, 2020 · 3 comments · Fixed by #12308
Assignees
Labels
bug Confirmed user-visible misbehaviour in official release fuzz Problem found by one of the fuzzers

Comments

@akuzm
Copy link
Contributor

akuzm commented Jul 3, 2020

CREATE TABLE delta_codec_synthetic
(
    `id` UInt64 CODEC(Delta, ZSTD(1048577))
)
ENGINE = MergeTree()
ORDER BY tuple()

[akuzm-nix] 2020.07.03 15:29:55.317909 [ 174944 ] <Fatal> BaseDaemon: ########################################
[akuzm-nix] 2020.07.03 15:29:55.319439 [ 174944 ] <Fatal> BaseDaemon: (version 20.6.1.1, build id: F54929D398A68BF3) (from thread 172629) (query_id: a5a3c0e2-85d4-4a8c-b769-82a183aeb0d1) Received signal Aborted (6)
[akuzm-nix] 2020.07.03 15:29:55.319915 [ 174944 ] <Fatal> BaseDaemon: 
[akuzm-nix] 2020.07.03 15:29:55.320401 [ 174944 ] <Fatal> BaseDaemon: Stack trace: 0x7f44215c418b 0x7f44215a3859 0x7f44215a3729 0x7f44215b4f36 0x7f44253b37bb 0x7f44163d4ada 0x7f44167a2a69 0x7f44167a4aca 0x7f44167a4a31 0x7f44167a4990 0x7f44167a4920 0x7f44167a3a52 0x7f44167e8513 0x7f44167de9eb 0x7f44167d9632 0x7f44167d8e0e 0x7f4415927206 0x7f44159277f1 0x7f4415929ab6 0x7f441592b9f4 0x7f4415d318da 0x7f4415d3099a 0x7f4412ac2953 0x7f4412ac9812 0x7f4422738d9c 0x7f44227395aa 0x7f442224c173 0x7f442224903d
[akuzm-nix] 2020.07.03 15:29:55.334424 [ 174944 ] <Fatal> BaseDaemon: 4. /build/glibc-YYA7BZ/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51: gsignal @ 0x4618b in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
[akuzm-nix] 2020.07.03 15:29:55.335313 [ 174944 ] <Fatal> BaseDaemon: 5. /build/glibc-YYA7BZ/glibc-2.31/stdlib/abort.c:81: abort @ 0x25859 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
[akuzm-nix] 2020.07.03 15:29:55.336317 [ 174944 ] <Fatal> BaseDaemon: 6. /build/glibc-YYA7BZ/glibc-2.31/intl/loadmsgcat.c:509: _nl_load_domain.cold @ 0x25729 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
[akuzm-nix] 2020.07.03 15:29:55.337074 [ 174944 ] <Fatal> BaseDaemon: 7. ? @ 0x36f36 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
[akuzm-nix] 2020.07.03 15:29:55.337663 [ 174944 ] <Fatal> BaseDaemon: 8. /home/akuzm/ch4/ch/src/Common/Exception.cpp:48: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x1b57bb in /home/akuzm/ch4/build-clang10/src/libclickhouse_common_iod.so
[akuzm-nix] 2020.07.03 15:29:55.338774 [ 174944 ] <Fatal> BaseDaemon: 9. /home/akuzm/ch4/ch/src/DataTypes/DataTypeNullable.cpp:500: DB::DataTypeNullable::getSizeOfValueInMemory() const @ 0x37bada in /home/akuzm/ch4/build-clang10/src/libclickhouse_datatypesd.so
[akuzm-nix] 2020.07.03 15:29:55.344357 [ 174944 ] <Fatal> BaseDaemon: 10. /home/akuzm/ch4/ch/src/Compression/CompressionCodecDelta.cpp:142: DB::(anonymous namespace)::getDeltaBytesSize(std::__1::shared_ptr<DB::IDataType const>) @ 0x8da69 in /home/akuzm/ch4/build-clang10/src/libclickhouse_compressiond.so
[akuzm-nix] 2020.07.03 15:29:55.345064 [ 174944 ] <Fatal> BaseDaemon: 11. /home/akuzm/ch4/ch/src/Compression/CompressionCodecDelta.cpp:161: DB::registerCodecDelta(DB::CompressionCodecFactory&)::$_0::operator()(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IDataType const>) const @ 0x8faca in /home/akuzm/ch4/build-clang10/src/libclickhouse_compressiond.so
[akuzm-nix] 2020.07.03 15:29:55.345843 [ 174944 ] <Fatal> BaseDaemon: 12. /home/akuzm/ch4/ch/contrib/libcxx/include/type_traits:3519: decltype(std::__1::forward<DB::registerCodecDelta(DB::CompressionCodecFactory&)::$_0&>(fp)(std::__1::forward<std::__1::shared_ptr<DB::IAST> const&>(fp0), std::__1::forward<std::__1::shared_ptr<DB::IDataType const> >(fp0))) std::__1::__invoke<DB::registerCodecDelta(DB::CompressionCodecFactory&)::$_0&, std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IDataType const> >(DB::registerCodecDelta(DB::CompressionCodecFactory&)::$_0&, std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IDataType const>&&) @ 0x8fa31 in /home/akuzm/ch4/build-clang10/src/libclickhouse_compressiond.so
[akuzm-nix] 2020.07.03 15:29:55.346690 [ 174944 ] <Fatal> BaseDaemon: 13. /home/akuzm/ch4/ch/contrib/libcxx/include/__functional_base:317: std::__1::shared_ptr<DB::ICompressionCodec> std::__1::__invoke_void_return_wrapper<std::__1::shared_ptr<DB::ICompressionCodec> >::__call<DB::registerCodecDelta(DB::CompressionCodecFactory&)::$_0&, std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IDataType const> >(DB::registerCodecDelta(DB::CompressionCodecFactory&)::$_0&, std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IDataType const>&&) @ 0x8f990 in /home/akuzm/ch4/build-clang10/src/libclickhouse_compressiond.so
[akuzm-nix] 2020.07.03 15:29:55.347558 [ 174944 ] <Fatal> BaseDaemon: 14. /home/akuzm/ch4/ch/contrib/libcxx/include/functional:1540: std::__1::__function::__alloc_func<DB::registerCodecDelta(DB::CompressionCodecFactory&)::$_0, std::__1::allocator<DB::registerCodecDelta(DB::CompressionCodecFactory&)::$_0>, std::__1::shared_ptr<DB::ICompressionCodec> (std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IDataType const>)>::operator()(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IDataType const>&&) @ 0x8f920 in /home/akuzm/ch4/build-clang10/src/libclickhouse_compressiond.so
[akuzm-nix] 2020.07.03 15:29:55.348380 [ 174944 ] <Fatal> BaseDaemon: 15. /home/akuzm/ch4/ch/contrib/libcxx/include/functional:1714: std::__1::__function::__func<DB::registerCodecDelta(DB::CompressionCodecFactory&)::$_0, std::__1::allocator<DB::registerCodecDelta(DB::CompressionCodecFactory&)::$_0>, std::__1::shared_ptr<DB::ICompressionCodec> (std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IDataType const>)>::operator()(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IDataType const>&&) @ 0x8ea52 in /home/akuzm/ch4/build-clang10/src/libclickhouse_compressiond.so
[akuzm-nix] 2020.07.03 15:29:55.361561 [ 174944 ] <Fatal> BaseDaemon: 16. /home/akuzm/ch4/ch/contrib/libcxx/include/functional:1867: std::__1::__function::__value_func<std::__1::shared_ptr<DB::ICompressionCodec> (std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IDataType const>)>::operator()(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IDataType const>&&) const @ 0xd3513 in /home/akuzm/ch4/build-clang10/src/libclickhouse_compressiond.so
[akuzm-nix] 2020.07.03 15:29:55.362409 [ 174944 ] <Fatal> BaseDaemon: 17. /home/akuzm/ch4/ch/contrib/libcxx/include/functional:2473: std::__1::function<std::__1::shared_ptr<DB::ICompressionCodec> (std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IDataType const>)>::operator()(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IDataType const>) const @ 0xc99eb in /home/akuzm/ch4/build-clang10/src/libclickhouse_compressiond.so
[akuzm-nix] 2020.07.03 15:29:55.362952 [ 174944 ] <Fatal> BaseDaemon: 18. /home/akuzm/ch4/ch/src/Compression/CompressionFactory.cpp:106: DB::CompressionCodecFactory::getImpl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IDataType const>) const @ 0xc4632 in /home/akuzm/ch4/build-clang10/src/libclickhouse_compressiond.so
[akuzm-nix] 2020.07.03 15:29:55.363430 [ 174944 ] <Fatal> BaseDaemon: 19. /home/akuzm/ch4/ch/src/Compression/CompressionFactory.cpp:59: DB::CompressionCodecFactory::get(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IDataType const>, bool) const @ 0xc3e0e in /home/akuzm/ch4/build-clang10/src/libclickhouse_compressiond.so
[akuzm-nix] 2020.07.03 15:29:55.366271 [ 174944 ] <Fatal> BaseDaemon: 20. /home/akuzm/ch4/ch/src/Interpreters/InterpreterCreateQuery.cpp:378: DB::InterpreterCreateQuery::getColumnsDescription(DB::ASTExpressionList const&, DB::Context const&, bool) @ 0x13d1206 in /home/akuzm/ch4/build-clang10/src/libclickhouse_interpretersd.so
[akuzm-nix] 2020.07.03 15:29:55.369148 [ 174944 ] <Fatal> BaseDaemon: 21. /home/akuzm/ch4/ch/src/Interpreters/InterpreterCreateQuery.cpp:415: DB::InterpreterCreateQuery::setProperties(DB::ASTCreateQuery&) const @ 0x13d17f1 in /home/akuzm/ch4/build-clang10/src/libclickhouse_interpretersd.so
[akuzm-nix] 2020.07.03 15:29:55.372375 [ 174944 ] <Fatal> BaseDaemon: 22. /home/akuzm/ch4/ch/src/Interpreters/InterpreterCreateQuery.cpp:602: DB::InterpreterCreateQuery::createTable(DB::ASTCreateQuery&) @ 0x13d3ab6 in /home/akuzm/ch4/build-clang10/src/libclickhouse_interpretersd.so
[akuzm-nix] 2020.07.03 15:29:55.375799 [ 174944 ] <Fatal> BaseDaemon: 23. /home/akuzm/ch4/ch/src/Interpreters/InterpreterCreateQuery.cpp:792: DB::InterpreterCreateQuery::execute() @ 0x13d59f4 in /home/akuzm/ch4/build-clang10/src/libclickhouse_interpretersd.so
[akuzm-nix] 2020.07.03 15:29:55.398181 [ 174944 ] <Fatal> BaseDaemon: 24. /home/akuzm/ch4/ch/src/Interpreters/executeQuery.cpp:385: DB::executeQueryImpl(char const*, char const*, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool, DB::ReadBuffer*) @ 0x17db8da in /home/akuzm/ch4/build-clang10/src/libclickhouse_interpretersd.so
[akuzm-nix] 2020.07.03 15:29:55.405188 [ 174944 ] <Fatal> BaseDaemon: 25. /home/akuzm/ch4/ch/src/Interpreters/executeQuery.cpp:644: DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool) @ 0x17da99a in /home/akuzm/ch4/build-clang10/src/libclickhouse_interpretersd.so
[akuzm-nix] 2020.07.03 15:29:55.406361 [ 174944 ] <Fatal> BaseDaemon: 26. /home/akuzm/ch4/ch/src/Server/TCPHandler.cpp:253: DB::TCPHandler::runImpl() @ 0x279953 in /home/akuzm/ch4/build-clang10/src/libclickhouse_serverd.so
[akuzm-nix] 2020.07.03 15:29:55.407652 [ 174944 ] <Fatal> BaseDaemon: 27. /home/akuzm/ch4/ch/src/Server/TCPHandler.cpp:1201: DB::TCPHandler::run() @ 0x280812 in /home/akuzm/ch4/build-clang10/src/libclickhouse_serverd.so
[akuzm-nix] 2020.07.03 15:29:55.408576 [ 174944 ] <Fatal> BaseDaemon: 28. /home/akuzm/ch4/ch/contrib/poco/Net/src/TCPServerConnection.cpp:43: Poco::Net::TCPServerConnection::start() @ 0x1b7d9c in /home/akuzm/ch4/build-clang10/contrib/poco-cmake/Net/lib_poco_netd.so
[akuzm-nix] 2020.07.03 15:29:55.425533 [ 174944 ] <Fatal> BaseDaemon: 29. /home/akuzm/ch4/ch/contrib/poco/Net/src/TCPServerDispatcher.cpp:114: Poco::Net::TCPServerDispatcher::run() @ 0x1b85aa in /home/akuzm/ch4/build-clang10/contrib/poco-cmake/Net/lib_poco_netd.so
[akuzm-nix] 2020.07.03 15:29:55.426658 [ 174944 ] <Fatal> BaseDaemon: 30. /home/akuzm/ch4/ch/contrib/poco/Foundation/src/ThreadPool.cpp:199: Poco::PooledThread::run() @ 0x276173 in /home/akuzm/ch4/build-clang10/contrib/poco-cmake/Foundation/lib_poco_foundationd.so
[akuzm-nix] 2020.07.03 15:29:55.427729 [ 174944 ] <Fatal> BaseDaemon: 31. /home/akuzm/ch4/ch/contrib/poco/Foundation/src/Thread.cpp:56: Poco::(anonymous namespace)::RunnableHolder::run() @ 0x27303d in /home/akuzm/ch4/build-clang10/contrib/poco-cmake/Foundation/lib_poco_foundationd.so
Error on processing query: CREATE TABLE delta_codec_synthetic (`id` UInt64 CODEC(Delta, ZSTD(1048577))) ENGINE = MergeTree() ORDER BY tuple()
Code: 32, e.displayText() = DB::Exception: Attempt to read after eof: while receiving packet from localhost:9000, Stack trace (when copying this message, always include the lines below):
@akuzm akuzm added bug Confirmed user-visible misbehaviour in official release fuzz Problem found by one of the fuzzers labels Jul 3, 2020
@alexey-milovidov
Copy link
Member

I have different (and correct) exception message:

CREATE TABLE delta_codec_synthetic
(
    `id` UInt64 CODEC(Delta, ZSTD(1048577))
)
ENGINE = MergeTree()
ORDER BY tuple()


Received exception from server (version 20.6.1):
Code: 433. DB::Exception: Received from localhost:9000. DB::Exception: ZSTD codec can't have level more that 22, given 1048577.

@alexey-milovidov
Copy link
Member

I can get logical error with this query:

CREATE TABLE delta_codec_synthetic
(
    `id` UInt64 NULL CODEC(Delta, ZSTD(22))
)
ENGINE = MergeTree()
ORDER BY tuple()


Received exception from server (version 20.6.1):
Code: 49. DB::Exception: Received from localhost:9000. DB::Exception: Value of type Nullable(UInt64) in memory is not of fixed size..

But it's just wrong exception code, need to change it to something more appropriate...

@filimonov
Copy link
Contributor

Relates #4609

alexey-milovidov added a commit that referenced this issue Jul 10, 2020
Fix wrong exception code in codecs Delta, DoubleDelta #12110
@alexey-milovidov alexey-milovidov self-assigned this Jul 12, 2020
alesapin added a commit that referenced this issue Jul 14, 2020
* update ya.make

* Added function "hasThreadFuzzer"

* Fix test under ThreadFuzzer

* Test for issue #9088

ALTER DELETE unexpectedly deletes NULL rows

* Remove unused potentially dangerous function

* Fix mutations interpreter #9088

* Added a test

* Added another test just in case

* Added yet another test just in case

* Update 01358_mutation_delete_null_rows.sql

* Fix test

* Fix flaky test

* Attempt to fix flaky test 00721_force_by_identical_result_after_merge_zookeeper

* [anchore] more detailed Dockerfile scan reports (#12159)

* Update Dockerfile

* Update array-functions.md (#12130)

修改编码错误

* Add integration test for mysql replacement query

* Update array-functions.md (#12129)

修改编码错误

* fix ubsan final

* [docs] improve redirects destination

* Update SECURITY.md (#12161)

* Update Dockerfile

* Update questdb_sum_double.xml

* Place common docker compose files to integration docker container

* done

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function (#12156)

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function

Signed-off-by: Slach <bloodjazman@gmail.com>

* small russian fixes

Signed-off-by: Slach <bloodjazman@gmail.com>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Remove -v from ninja

* [docs] introduction for integration table engines (#12167)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* Fix #10437, CR fixes

* fix style

* add select final to test

* Same change for Kafka - just in case, and to make it conform.

* Fix dictGet with bad arguments during GROUP BY injective functions elimination

* Fix dictGet arguments check during GROUP BY injective functions elimination

This patch changes the place where the dictionary will be loaded (during
syntax analysis), but I guess this is fine, it will be loaded anyway.

Fixes: #10342

* [docs] add redirect from an introduction index page (#12176)

* [website] add apple-touch-icon (#12164)

* Use ENABLE_LIBRARIES option for AMQP-CPP

This is tiny fix, there are more problems that just this small little
bit.

* Set GOOGLETEST_VERSION for googletest

Otherwise cmake reports:

    CMake Warning at contrib/googletest/googletest/CMakeLists.txt:54 (project):
      VERSION keyword not followed by a value or was followed by a value that
      expanded to nothing.

(since GOOGLETEST_VERSION is set in contrib/googletest/CMakeLists.txt)

* Bump googletest to master (to fix gcc10 builds)

gcc10 reports:

    FAILED: src/CMakeFiles/unit_tests_dbms.dir/Columns/tests/gtest_column_unique.cpp.o
    <snip>
    ../contrib/googletest/googletest/include/gtest/gtest-printers.h:287:7: error: use of deleted function ‘std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char8_t) [with _Traits = std::char_traits<char>]’
      287 |   *os << value;
          |   ~~~~^~~~~~~~
    In file included from ../base/common/../common/StringRef.h:6,
                     from ../src/Columns/IColumn.h:7,
                     from ../src/Columns/IColumnUnique.h:2,
                     from ../src/Columns/ColumnUnique.h:2,
                     from ../src/Columns/tests/gtest_column_unique.cpp:1:
    /usr/include/c++/10.1.0/ostream:544:5: note: declared here
      544 |     operator<<(basic_ostream<char, _Traits>&, char8_t) = delete;
          |

* gtest_compressionCodec: is_trivial+is_standard_layout over deprecated is_pod

* gtest_compressionCodec: use fmt over boost::format

boost::format is not compiled under gcc10:

                     from ../src/Compression/tests/gtest_compressionCodec.cpp:14:
    /usr/include/boost/format/alt_sstream_impl.hpp: In instantiation of ‘boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type boost::io::basic_altstringbuf<Ch, Tr, Alloc>::overflow(boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type) [with Ch = char; Tr = std::char_traits<char>; Alloc = std::allocator<char>; boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type = int]’:
    /usr/include/boost/format/alt_sstream_impl.hpp:227:9:   required from here
    /usr/include/boost/format/alt_sstream_impl.hpp:261:45: error: no matching function for call to ‘std::allocator<char>::allocate(std::size_t&, char*)’
      261 |                     newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);

(although this is system-wide boost, it is pretty recent - 1.72)

* gtest_compressionCodec: fix lack of operator<< for char8_t

* gtest_weak_hash_32: fix lack of operator<< for char8_t

* Force CMP0022 for googletest (to avoid using LINK_INTERFACE_LIBRARIES(_<CONFIG>)?)

Othewise cmake reports:

    -- Configuring done
    CMake Warning (dev) in contrib/googletest/googletest/CMakeLists.txt:
      Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
      interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.

      Target "gtest" has an INTERFACE_LINK_LIBRARIES property which differs from
      its LINK_INTERFACE_LIBRARIES_DEBUG properties.

      INTERFACE_LINK_LIBRARIES:

        global-group;Threads::Threads

      LINK_INTERFACE_LIBRARIES_DEBUG:

        Threads::Threads

    This warning is for project developers.  Use -Wno-dev to suppress it.

    -- Generating done
    -- Build files have been written to: /src/ch/clickhouse/.cmake-tmp

* Set CMP0077 for re2

cmake reports:

    CMake Warning (dev) at contrib/re2/CMakeLists.txt:15 (option):
      Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
      --help-policy CMP0077" for policy details.  Use the cmake_policy command to
      set the policy and suppress this warning.

      For compatibility with older versions of CMake, option is clearing the
      normal variable 'BUILD_SHARED_LIBS'.
    This warning is for project developers.  Use -Wno-dev to suppress it.

* Better assert

* Don't split dictionary source's table name into schema and table name itself
if ODBC driver doesn't support schema.

* Sync reference file with changes in sql file

* [docs] introduction for third-party interfaces (#12175)

* [docs] introduction for third-party interfaces

* Update index.md

* Update index.md

* [docs] introduction for special table engines (#12170)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* [docs] introduction for special table engines

* Update index.md

* Update index.md

* Cap max_memory_usage* limits to the process resident memory

There are still some issues with memory tracking, but now with per-user
tracking:

    executeQuery: Code: 241, e.displayText() = DB::Exception: Memory limit (for user) exceeded: would use 437.72 GiB (attempt to allocate chunk of 4200926 bytes), maximum: 437.72 GiB (version 20.6.1.1) (from 10.7.140.7:31318)

Although the server is mostly idle:

    SELECT formatReadableSize(memory_usage)
    FROM system.processes

    ┌─formatReadableSize(memory_usage)─┐
    │ 289.28 MiB                       │
    │ 155.75 MiB                       │
    │ 0.00 B                           │
    └──────────────────────────────────┘

Refs: https://github.com/ClickHouse/ClickHouse/pull/10496/files#r450206865
Cc: @alexey-milovidov

* gtest_compressionCodec: suppress non instantiated gtest warning

gtest reports:

    [ RUN      ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance>
    ../src/Compression/tests/gtest_compressionCodec.cpp:590: Failure
    Parameterized test suite CodecTestPerformance is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.

    Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)

    To suppress this error for this test suite, insert the following line (in a non-header) in the namespace it is defined in:

    GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CodecTestPerformance);
    [  FAILED  ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance> (0 ms)

* Fix tests.

* split

* Do not try to adjust memory tracker amount if it is not larger then in total

* A test for UInt8 as bool

* Included const uint8 values in test

* changelog fixes

* remove questionable functionality

* Tests for fixed issues #10846 and #7347

* Simple (and fast) inplace fix for UInt8 -> bool

* style fix for #12152

* Added test for #3767

* Update zh kafka.md title (#12192)

* Update index.md (#12191)

Fix merge link broken

* changelog fixes

* done

* DOCSUP-1348 Russian translation for new functions (#133) (#12194)

* Russian translation for new functions

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor updates to russian text.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>

* Add runner for testflows

* fixes

* No color

* throw exception on redirect limit in S3 request

* fix test

* [docs] add intrdocution for commercial page (#12187)

* DOCS-647: toStartOfSecond (#12190)

* DOCSUP-1120 Documentation for the toStartOfSecond function (#131)

* Doc toStartOfSecond function

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor update for english text, russian translation added.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-647: Minor text edits.

* Update docs/en/sql-reference/functions/date-time-functions.md

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* [docs] refactor Domains overview (#12186)

* Add to images.json

* Sanitize LINK_LIBRARIES property for the directories (#12160)

When you will try to link target with the directory (that exists), cmake will
skip this without an error, only the following warning will be reported:

    target_link_libraries(main /tmp)

    WARNING: Target "main" requests linking to directory "/tmp".  Targets may link only to libraries.  CMake is dropping the item.

And there is no cmake policy that controls this.
(I guess the reason that it is allowed is because of FRAMEWORK for OSX).

So to avoid error-prone cmake rules, this can be sanitized.
There are the following ways:
- overwrite target_link_libraries()/link_libraries() and check *before*
  calling real macro, but this requires duplicate all supported syntax
  -- too complex
- overwrite target_link_libraries() and check LINK_LIBRARIES property, this
  works great
  -- but cannot be used with link_libraries()
- use BUILDSYSTEM_TARGETS property to get list of all targets and sanitize
  -- this will work.

I also tested it with the following patch:

    $ git di
    diff --git a/base/daemon/CMakeLists.txt b/base/daemon/CMakeLists.txt
    index 26d59a57e7..35e6ff6432 100644
    --- a/base/daemon/CMakeLists.txt
    +++ b/base/daemon/CMakeLists.txt
    @@ -9,4 +9,5 @@ target_link_libraries (daemon PUBLIC loggers PRIVATE clickhouse_common_io clickh

     if (USE_SENTRY)
         target_link_libraries (daemon PRIVATE ${SENTRY_LIBRARY})
    +    target_link_libraries (daemon PRIVATE /tmp)
     endif ()

And it works:

    CMake Error at cmake/sanitize_target_link_libraries.cmake:48 (message):
       daemon requested to link with directory: /tmp
    Call Stack (most recent call first):
      cmake/sanitize_target_link_libraries.cmake:55 (sanitize_link_libraries)
      CMakeLists.txt:425 (include)

Refs: #12041

* cleanup

* cleanup

* Revert "Run perf tests with memory sampling (for allocations >1M)"

* too slow

* style

* [docs] add intrdocution for statements page (#12189)

* [docs] add intrdocution for statements page

* Update index.md

* Update index.md

* Update README.md

* Update README.md

* Update README.md

* AMQP requires libuv

Otherwise fails:

    FAILED: src/CMakeFiles/dbms.dir/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp.o
    ...
    In file included from ../src/Storages/RabbitMQ/RabbitMQHandler.h:9,
                     from ../src/Storages/RabbitMQ/StorageRabbitMQ.h:11,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.h:5,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp:3:
    ../contrib/AMQP-CPP/include/amqpcpp/libuv.h:22:10: fatal error: uv.h: No such file or directory

* Rename ident to indent.

* Bump arrow to 0.17 (and flatbuffers to v1.12, required by arrow)

MOTIVATION:
- remove double-conversion external dependency
- remove flatc (but flatbuffers is still required, arrow just shipped
  with generated files and that's it)

CHANGED:
- remove pre-generated headers, it is shipped with the arrow
- remove flatc (see above)

NOTES (see tests changes):
- and snappy error is reported as unsupported compression.

* Fix minor issues after #12196

* Reset CurrentMetrics::MemoryTracking periodically to the process RSS

* Allow isInjective() with empty block (is function injective with any arguments)

Since most of the time function will ignore it anyway, and creating
arguments just for checking is function injective or not is overkill

* Implement getLeastSuperType for LowCardinality #8212

* Implement supertype for LowCardinality

* Whitespace

* Update test

* Added a test for PaddedPODArray just in case

* Add documentation for arrayFill

* Fix ugly ugliness

* Added a test

* Non-significant changes

* Update README.md

* Fix skip lists for old branches

* Update int_parsing.xml

* Update build.sh

* Fixes

* Update packager

* Hide nonzero error code on testflows runner

* fix builds

* Show error after TrieDictionary failed to load.

* try remove strange logic in DuplicateOrderByVisitor (#12267)

* Update README.md

* Fix typo in setting name

* Update README.md

* Fix typo in setting name

* Add tests to skip list

* Update README.md

* Update README.md

* Rerun tests

* Ignore testflows exit code

* More skip checks

* get hostname without mutex

* Add more tests to skip

* Bump CI (after non-restartable inner CI issue)

This reverts commit d199961.

* Added a test

* Fix strange code CC @Enmk. Prove: g++ -xc++ -include vector - <<< 'int main() { return std::vector<const char>{1, 2, 3}.size(); }'

* fix TTL after renaming column

* Fix ORC build (#12258)

* first try

* change submodule

* Update .gitmodules

* include build directory

* Update .gitmodules

Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>

* Fix filtering by virtual columns #12166

* Added a test

* fix order of columns in WITH FILL modifier

* Fix wrong exception code in codecs Delta, DoubleDelta #12110

* Added a test

* Fix outstandingly wrong code

* Remove ridiculous code

* Fix strange things

* Fix bad code, once again

* Remove bad ugliness

* Remove something obviously wrong

* Remove another chunk of unneeded code

* Fix "Arcadia" build

* Log sanitizer trap messages from separate thread

* Revert strange file

* Tested with "trap" function

* Support MySQL 'SELECT DATABASE()' query replacement

* Fix race condition in ReplicatedMergeTreeQueue

* Fix build

* Fix bad code

* Fix issues

* Set CMAKE_POLICY_DEFAULT_CMP0022/CMAKE_POLICY_DEFAULT_CMP0077 globally

This will fix CMAKE_POLICY_DEFAULT_CMP0077 for snappy:

    CMake Warning (dev) at contrib/snappy/CMakeLists.txt:11 (option):
      Policy CMP0077 is not set: option() honors normal variables.  Run
    "cmake
      --help-policy CMP0077" for policy details.  Use the cmake_policy
    command to
      set the policy and suppress this warning.

      For compatibility with older versions of CMake, option is clearing the
      normal variable 'BUILD_SHARED_LIBS'.
    This warning is for project developers.  Use -Wno-dev to suppress it.

* Update config.h for arrow

Yes ARROW_FULL_SO_VERSION/ARROW_SO_VERSION is empty right now, like
other version variables (ARROW_VERSION_*)

Refs: #12181

* Fix jemalloc enabled detection (should goes after contrib inclusion)

* Warn if jemalloc is not enabled for non-linux too

Refs: #11897 (osx)
Refs: #11774 (freebsd)

* DOCS-679: netloc function (#12321)

* DOCSUP-1377 (netloc function) (#135)

* add EN description

* changes in query

* changes after review

* add RU description

* CLICKHOUSEDOCS-679: Text fixes.

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: emironyuk <em@don.ru>
Co-authored-by: Evgenia Sudarikova <56156889+otrazhenia@users.noreply.github.com>

* add docker image for fuzzer

* fixes in fuzzer docker image

* [docs] engine family introduction refactoring (#12268)

* base refactoring

* adjust links

* Update index.md

* Implemented single part uploads for DiskS3 (#12026)

* Implemented single part uploads for DiskS3.
* Added `min_multi_part_upload_size` to disk configuration.

* Initial version

* Rename test 01378

* Add integration test for mysql replacement query

* Human readable errors in alter rename queries

* Fix tests

* Revert unrelated changes

* Fix obvious race condition in test

* [docs] split various kinds of CREATE queries into separate articles (#12328)

* normalize

* split & adjust links

* re-normalize

* adjust ru links

* adjust ja/tr links

* partially apply e0d19d2

* reset contribs

* Update skip_list.json

* fuzzer container fix

* fuzzer docker image

* Fix tests

* Fix error

* Remove useless code

* Miscellaneous

* Allow to parse operator NOT as a function #12262

* Allow to parse operator NOT as a function #12262

Co-authored-by: Guillaume Tassery <gtassery@partners.accedian.com>
Co-authored-by: Alexey Milovidov <milovidov@yandex-team.ru>
Co-authored-by: Mikhail Filimonov <mfilimonov@altinity.com>
Co-authored-by: Yatsishin Ilya <2159081+qoega@users.noreply.github.com>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>
Co-authored-by: yhgcn <yhg_cn@163.com>
Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
Co-authored-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com>
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
Co-authored-by: alesapin <alesapin@gmail.com>
Co-authored-by: Anton Popov <pad11rus@gmail.com>
Co-authored-by: Eugene Klimov <bloodjazman@gmail.com>
Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Co-authored-by: Vitaly Baranov <vitbar@yandex-team.ru>
Co-authored-by: Alexander Kazakov <Akazz@users.noreply.github.com>
Co-authored-by: Nikolai Kochetov <nik-kochetov@yandex-team.ru>
Co-authored-by: tavplubix <avtokmakov@yandex-team.ru>
Co-authored-by: Alexander Kuzmenkov <akuzm@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Anton Ivashkin <iantonspb@yandex-team.ru>
Co-authored-by: Artem Zuikov <chertus@gmail.com>
Co-authored-by: emironyuk <em@don.ru>
Co-authored-by: Evgenia Sudarikova <56156889+otrazhenia@users.noreply.github.com>
Co-authored-by: Vladimir Chebotarev <vladimir.chebotarev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed user-visible misbehaviour in official release fuzz Problem found by one of the fuzzers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants