I have created MaterializeMySQL with：
CREATE DATABASE dmp_idm ENGINE = MaterializeMySQL('xxx:3307', 'dmp_idm', 'root', 'xxx');
====================
my.cnf：
gtid_mode=on
enforce_gtid_consistency=true 
binlog_format=ROW
log-bin=mysql-bin
===================
see the log：
tail -100f clickhouse-server.err.log
2020.09.17 10:37:30.979768 [ 13674 ] {} <Fatal> BaseDaemon: ########################################
2020.09.17 10:37:30.979849 [ 13674 ] {} <Fatal> BaseDaemon: (version 20.9.1.4571 (official build), no build id) (from thread 13578) (no query) Received signal Segmentation fault (11)
2020.09.17 10:37:30.979889 [ 13674 ] {} <Fatal> BaseDaemon: Address: 0x2d85ef80 Access: write. Address not mapped to object.
2020.09.17 10:37:30.979914 [ 13674 ] {} <Fatal> BaseDaemon: Stack trace: 0x15c225a8 0x15c188f8 0x15c1bf25 0x15889272 0x15bf6aa2 0x15bf8402 0x157e7064 0x157f10d5 0x157f2803 0x1582ccb9 0x1582f0ee 0x157eaa91 0x157ef71b 0x157efc36 0xe641547 0xe63fb83 0x7fd0189fcdc5 0x7fd01831e21d
2020.09.17 10:37:30.980005 [ 13674 ] {} <Fatal> BaseDaemon: 3. std::__1::enable_if<(std::__1::__is_cpp17_forward_iterator<std::__1::__wrap_iter<std::__1::shared_ptr<DB::IAST>*> >::value) && (std::__1::is_constructible<std::__1::shared_ptr<DB::IAST>, std::__1::iterator_traits<std::__1::iterator_traits>::reference>::value), std::__1::__wrap_iter<std::__1::shared_ptr<DB::IAST>*> >::type std::__1::vector<std::__1::shared_ptr<DB::IAST>, std::__1::allocator<std::__1::shared_ptr<DB::IAST> > >::insert<std::__1::__wrap_iter<std::__1::shared_ptr<DB::IAST>*> >(std::__1::__wrap_iter<std::__1::shared_ptr<DB::IAST> const*>, std::__1::iterator_traits, std::__1::iterator_traits) @ 0x15c225a8 in /usr/bin/clickhouse
2020.09.17 10:37:30.980034 [ 13674 ] {} <Fatal> BaseDaemon: 4. ? @ 0x15c188f8 in /usr/bin/clickhouse
2020.09.17 10:37:30.980056 [ 13674 ] {} <Fatal> BaseDaemon: 5. DB::MySQLInterpreter::InterpreterCreateImpl::getRewrittenQueries(DB::MySQLParser::ASTCreateQuery const&, DB::Context 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&) @ 0x15c1bf25 in /usr/bin/clickhouse
2020.09.17 10:37:30.980081 [ 13674 ] {} <Fatal> BaseDaemon: 6. DB::InterpreterExternalDDLQuery::execute() @ 0x15889272 in /usr/bin/clickhouse
2020.09.17 10:37:30.980095 [ 13674 ] {} <Fatal> BaseDaemon: 7. ? @ 0x15bf6aa2 in /usr/bin/clickhouse
2020.09.17 10:37:30.980113 [ 13674 ] {} <Fatal> BaseDaemon: 8. DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool) @ 0x15bf8402 in /usr/bin/clickhouse
2020.09.17 10:37:30.980126 [ 13674 ] {} <Fatal> BaseDaemon: 9. ? @ 0x157e7064 in /usr/bin/clickhouse
2020.09.17 10:37:30.980138 [ 13674 ] {} <Fatal> BaseDaemon: 10. ? @ 0x157f10d5 in /usr/bin/clickhouse
2020.09.17 10:37:30.980149 [ 13674 ] {} <Fatal> BaseDaemon: 11. ? @ 0x157f2803 in /usr/bin/clickhouse
2020.09.17 10:37:30.980174 [ 13674 ] {} <Fatal> BaseDaemon: 12. 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&) @ 0x1582ccb9 in /usr/bin/clickhouse
2020.09.17 10:37:30.980195 [ 13674 ] {} <Fatal> BaseDaemon: 13. DB::MaterializeMetadata::transaction(DB::MySQLReplication::Position const&, std::__1::function<void ()> const&) @ 0x1582f0ee in /usr/bin/clickhouse
2020.09.17 10:37:30.980226 [ 13674 ] {} <Fatal> BaseDaemon: 14. DB::MaterializeMySQLSyncThread::prepareSynchronized(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x157eaa91 in /usr/bin/clickhouse
2020.09.17 10:37:30.980249 [ 13674 ] {} <Fatal> BaseDaemon: 15. DB::MaterializeMySQLSyncThread::synchronization(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x157ef71b in /usr/bin/clickhouse
2020.09.17 10:37:30.980261 [ 13674 ] {} <Fatal> BaseDaemon: 16. ? @ 0x157efc36 in /usr/bin/clickhouse
2020.09.17 10:37:30.980279 [ 13674 ] {} <Fatal> BaseDaemon: 17. ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0xe641547 in /usr/bin/clickhouse
2020.09.17 10:37:30.980291 [ 13674 ] {} <Fatal> BaseDaemon: 18. ? @ 0xe63fb83 in /usr/bin/clickhouse
2020.09.17 10:37:30.980329 [ 13674 ] {} <Fatal> BaseDaemon: 19. start_thread @ 0x7dc5 in /usr/lib64/libpthread-2.17.so
2020.09.17 10:37:30.980349 [ 13674 ] {} <Fatal> BaseDaemon: 20. clone @ 0xf621d in /usr/lib64/libc-2.17.so
2020.09.17 10:38:11.697416 [ 13738 ] {} <Error> MaterializeMySQLSyncThread: Code: 76, e.displayText() = DB::ErrnoException: Cannot open file /data/clickhouse/metadata/dmp_idm//.metadata.tmp, errno: 17, strerror: File exists, Stack trace (when copying this message, always include the lines below):

0. Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x18bcb170 in /usr/bin/clickhouse
1. DB::ErrnoException::ErrnoException(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int, std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) @ 0xe617f8b in /usr/bin/clickhouse
2. DB::throwFromErrnoWithPath(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&, int, int) @ 0xe615d8a in /usr/bin/clickhouse
3. DB::WriteBufferFromFile::WriteBufferFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, int, unsigned int, char*, unsigned long) @ 0xe71f608 in /usr/bin/clickhouse
4. DB::MaterializeMetadata::transaction(DB::MySQLReplication::Position const&, std::__1::function<void ()> const&) @ 0x1582e78c in /usr/bin/clickhouse
5. DB::MaterializeMySQLSyncThread::prepareSynchronized(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x157eaa91 in /usr/bin/clickhouse
6. DB::MaterializeMySQLSyncThread::synchronization(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x157ef71b in /usr/bin/clickhouse
7. ? @ 0x157efc36 in /usr/bin/clickhouse
8. ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0xe641547 in /usr/bin/clickhouse
9. ? @ 0xe63fb83 in /usr/bin/clickhouse
10. start_thread @ 0x7dc5 in /usr/lib64/libpthread-2.17.so
11. clone @ 0xf621d in /usr/lib64/libc-2.17.so
 (version 20.9.1.4571 (official build))
2020.09.17 10:38:11.698228 [ 13738 ] {} <Error> MaterializeMySQLSyncThread: Code: 76, e.displayText() = DB::ErrnoException: Cannot open file /data/clickhouse/metadata/dmp_idm//.metadata.tmp, errno: 17, strerror: File exists, Stack trace (when copying this message, always include the lines below):

0. Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x18bcb170 in /usr/bin/clickhouse
1. DB::ErrnoException::ErrnoException(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int, std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) @ 0xe617f8b in /usr/bin/clickhouse
2. DB::throwFromErrnoWithPath(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&, int, int) @ 0xe615d8a in /usr/bin/clickhouse
3. DB::WriteBufferFromFile::WriteBufferFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, int, unsigned int, char*, unsigned long) @ 0xe71f608 in /usr/bin/clickhouse
4. DB::MaterializeMetadata::transaction(DB::MySQLReplication::Position const&, std::__1::function<void ()> const&) @ 0x1582e78c in /usr/bin/clickhouse
5. DB::MaterializeMySQLSyncThread::prepareSynchronized(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x157eaa91 in /usr/bin/clickhouse
6. DB::MaterializeMySQLSyncThread::synchronization(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x157ef71b in /usr/bin/clickhouse
7. ? @ 0x157efc36 in /usr/bin/clickhouse
8. ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0xe641547 in /usr/bin/clickhouse
9. ? @ 0xe63fb83 in /usr/bin/clickhouse
10. start_thread @ 0x7dc5 in /usr/lib64/libpthread-2.17.so
11. clone @ 0xf621d in /usr/lib64/libc-2.17.so
 (version 20.9.1.4571 (official build))
2020.09.17 10:38:26.307285 [ 13793 ] {fc34c804-2465-413b-97f6-cb7aca0526c8} <Error> executeQuery: Code: 76, e.displayText() = DB::Exception: Cannot open file /data/clickhouse/metadata/dmp_idm//.metadata.tmp, errno: 17, strerror: File exists (version 20.9.1.4571 (official build)) (from 172.30.108.6:51390) (in query: SELECT * FROM dmp_idm.invitation FORMAT TabSeparatedWithNamesAndTypes;), Stack trace (when copying this message, always include the lines below):

0. Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x18bcb170 in /usr/bin/clickhouse
1. DB::ErrnoException::ErrnoException(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int, std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) @ 0xe617f8b in /usr/bin/clickhouse
2. DB::throwFromErrnoWithPath(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&, int, int) @ 0xe615d8a in /usr/bin/clickhouse
3. DB::WriteBufferFromFile::WriteBufferFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, int, unsigned int, char*, unsigned long) @ 0xe71f608 in /usr/bin/clickhouse
4. DB::MaterializeMetadata::transaction(DB::MySQLReplication::Position const&, std::__1::function<void ()> const&) @ 0x1582e78c in /usr/bin/clickhouse
5. DB::MaterializeMySQLSyncThread::prepareSynchronized(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x157eaa91 in /usr/bin/clickhouse
6. DB::MaterializeMySQLSyncThread::synchronization(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x157ef71b in /usr/bin/clickhouse
7. ? @ 0x157efc36 in /usr/bin/clickhouse
8. ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0xe641547 in /usr/bin/clickhouse
9. ? @ 0xe63fb83 in /usr/bin/clickhouse
10. start_thread @ 0x7dc5 in /usr/lib64/libpthread-2.17.so
11. clone @ 0xf621d in /usr/lib64/libc-2.17.so

2020.09.17 10:38:26.307798 [ 13793 ] {fc34c804-2465-413b-97f6-cb7aca0526c8} <Error> DynamicQueryHandler: Code: 76, e.displayText() = DB::Exception: Cannot open file /data/clickhouse/metadata/dmp_idm//.metadata.tmp, errno: 17, strerror: File exists, Stack trace (when copying this message, always include the lines below):

0. Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x18bcb170 in /usr/bin/clickhouse
1. DB::ErrnoException::ErrnoException(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int, std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) @ 0xe617f8b in /usr/bin/clickhouse
2. DB::throwFromErrnoWithPath(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&, int, int) @ 0xe615d8a in /usr/bin/clickhouse
3. DB::WriteBufferFromFile::WriteBufferFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, int, unsigned int, char*, unsigned long) @ 0xe71f608 in /usr/bin/clickhouse
4. DB::MaterializeMetadata::transaction(DB::MySQLReplication::Position const&, std::__1::function<void ()> const&) @ 0x1582e78c in /usr/bin/clickhouse
5. DB::MaterializeMySQLSyncThread::prepareSynchronized(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x157eaa91 in /usr/bin/clickhouse
6. DB::MaterializeMySQLSyncThread::synchronization(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x157ef71b in /usr/bin/clickhouse
7. ? @ 0x157efc36 in /usr/bin/clickhouse
8. ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0xe641547 in /usr/bin/clickhouse
9. ? @ 0xe63fb83 in /usr/bin/clickhouse
10. start_thread @ 0x7dc5 in /usr/lib64/libpthread-2.17.so
11. clone @ 0xf621d in /usr/lib64/libc-2.17.so
 (version 20.9.1.4571 (official build))


help me，please!
{
    Block header{{std::make_shared<DataTypeString>(), "table_name"}};
    String query = "SELECT TABLE_NAME AS table_name FROM INFORMATION_SCHEMA.TABLES  WHERE TABLE_SCHEMA = " + quoteString(database);
    std::vector<String> tables_in_db;
    MySQLBlockInputStream input(connection, query, header, DEFAULT_BLOCK_SIZE);
    while (Block block = input.read())
    {
        tables_in_db.reserve(tables_in_db.size() + block.rows());
        for (size_t index = 0; index < block.rows(); ++index)
            tables_in_db.emplace_back((*block.getByPosition(0).column)[index].safeGet<String>());
    }
    return tables_in_db;
}
void MaterializeMetadata::fetchMasterStatus(mysqlxx::PoolWithFailover::Entry & connection)