Skip to content

ISSUES-18684 fix MaterializeMySQL integration test failure - #19344

Merged
tavplubix merged 2 commits into
ClickHouse:masterfrom
zhang2014:patch-2
Jan 25, 2021
Merged

tavplubix merged 2 commits into
ClickHouse:masterfrom
zhang2014:patch-2

Conversation

@zhang2014

Copy link
Copy Markdown
Contributor

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
#18684
fix MaterializeMySQL integration test failure

@robot-clickhouse robot-clickhouse added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jan 21, 2021
@tavplubix tavplubix self-assigned this Jan 22, 2021
Comment on lines +463 to 464
check_query(clickhouse_node, "SHOW TABLES FROM test_database FORMAT TSV", "t1\n")
check_query(clickhouse_node, "SELECT * FROM test_database.t1 ORDER BY a FORMAT TSV", "1\tBEGIN\n2\tBEGIN\n")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but how does it fix the failure? check_query retries not only in case of wrong query result, but also in case of exception. So, if SELECT * FROM test_database.t1 ORDER BY a FORMAT TSV fails with Table test_database.t1 doesn't exist, then check_query retires the query.

Also there are error messages with other table names (test_table_1, test_table_2) in the report, it's not only about t1.

@zhang2014 zhang2014 Jan 24, 2021 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.
@tavplubix you are right, the test failed because enable_global_with_statement = true https://github.com/ClickHouse/ClickHouse/blob/master/src/Interpreters/executeQuery.cpp#L458

2021.01.21 08:55:36.471137 [ 51 ] {} <Error> MaterializeMySQLSyncThread(kill_clickhouse_while_insert): Query EXTERNAL DDL FROM MySQL(kill_clickhouse_while_insert, kill_clickhouse_while_insert)  CREATE TABLE `test` (
  `id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 wasn't finished successfully: Code: 48, e.displayText() = DB::Exception: Method formatImpl is not supported by MySQLParser::ASTCreateQuery., Stack trace (when copying this message, always include the lines below):

0. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/exception:133: Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x2620d9b9 in /usr/bin/clickhouse
1. ./obj-x86_64-linux-gnu/../src/Common/Exception.cpp:55: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0xa8791f1 in /usr/bin/clickhouse
2. ./obj-x86_64-linux-gnu/../src/Parsers/MySQL/ASTCreateQuery.h:37: DB::MySQLParser::ASTCreateQuery::formatImpl(DB::IAST::FormatSettings const&, DB::IAST::FormatState&, DB::IAST::FormatStateStacked) const @ 0x250dcce6 in /usr/bin/clickhouse
3. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/__tree:1079: DB::serializeAST(DB::IAST const&, bool) @ 0x250a037c in /usr/bin/clickhouse
4. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/string:1444: DB::executeQueryImpl(char const*, char const*, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool, DB::ReadBuffer*) @ 0x1ee52d77 in /usr/bin/clickhouse
5. ./obj-x86_64-linux-gnu/../src/Interpreters/executeQuery.cpp:868: DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool) @ 0x1ee509f8 in /usr/bin/clickhouse
6. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/string:1444: DB::tryToExecuteQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x1dd97e1b in /usr/bin/clickhouse
7. ./obj-x86_64-linux-gnu/../src/Databases/MySQL/MaterializeMySQLSyncThread.cpp:296: void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<DB::MaterializeMySQLSyncThread::prepareSynchronized()::$_1, void ()> >(std::__1::__function::__policy_storage const*) @ 0x1dda8f20 in /usr/bin/clickhouse
8. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:0: DB::commitMetadata(std::__1::function<void ()> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x1de10aa7 in /usr/bin/clickhouse
9. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/string:1444: DB::MaterializeMetadata::transaction(DB::MySQLReplication::Position const&, std::__1::function<void ()> const&) @ 0x1de117c1 in /usr/bin/clickhouse
10. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:2191: DB::MaterializeMySQLSyncThread::prepareSynchronized() @ 0x1dd86ea4 in /usr/bin/clickhouse
11. ./obj-x86_64-linux-gnu/../src/Databases/MySQL/MaterializeMySQLSyncThread.cpp:0: DB::MaterializeMySQLSyncThread::synchronization() @ 0x1dd8528b in /usr/bin/clickhouse
12. ./obj-x86_64-linux-gnu/../src/Common/ThreadPool.h:179: void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::MaterializeMySQLSyncThread::startSynchronization()::$_0>(DB::MaterializeMySQLSyncThread::startSynchronization()::$_0&&)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) @ 0x1dda6dfd in /usr/bin/clickhouse
13. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:0: ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0xa8c6bec in /usr/bin/clickhouse
14. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:1655: void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()> >(void*) @ 0xa8cf784 in /usr/bin/clickhouse
15. start_thread @ 0x9609 in /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
16. __clone @ 0x122293 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
 (version 21.1.1.5741)

@tavplubix

Copy link
Copy Markdown
Member

AST fuzzer (ASan) - #19108
AST fuzzer (UBSan) - #19566

@tavplubix
tavplubix merged commit 4be33e8 into ClickHouse:master Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants