(you don't have to strictly follow this form)

**Describe the bug**

After create database with engine MaterializeMySQL, clickhouse server Segmentation fault and restart

**How to reproduce**
* 20.10.2.20 (official build)
* `CREATE DATABASE xxx ENGINE = MaterializeMySQL('host', 'dbname', 'user', 'pass');`

**Error message and/or stacktrace**

```
2020.10.26 10:56:31.340735 [ 18476 ] {} <Fatal> BaseDaemon: ########################################
2020.10.26 10:56:31.340793 [ 18476 ] {} <Fatal> BaseDaemon: (version 20.10.2.20 (official build), build id: FFE5E11E2023F86A) (from thread 1298) (no query) Received signal Segmentation fault (11)
2020.10.26 10:56:31.340818 [ 18476 ] {} <Fatal> BaseDaemon: Address: 0xfffffffffb0f8320 Access: write. Address not mapped to object.
2020.10.26 10:56:31.340840 [ 18476 ] {} <Fatal> BaseDaemon: Stack trace: 0xdef5e7e 0xdeeaeec 0xdb5214c 0xdb511d7 0xdecaff8 0xdec9e9d 0xdb00ba4 0xdb16b98 0xdb1c79e 0xdb1cc91 0xdafa7a9 0xdaf9e2a 0xdb162cd 0x7b8b75d 0x7b8f273 0x7fb9096a12de 0x7fb908fc5133
2020.10.26 10:56:31.340923 [ 18476 ] {} <Fatal> BaseDaemon: 2. std::__1::enable_if<(__is_cpp17_forward_iterator<std::__1::__wrap_iter<std::__1::shared_ptr<DB::IAST>*> >::value) && (is_constructible<std::__1::shared_ptr<DB::IAST>, std::__1::iterator_traits<std::__1::__wrap_iter<std::__1::shared_ptr<DB::IAST>*> >::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::__wrap_iter<std::__1::shared_ptr<DB::IAST>*>, std::__1::__wrap_iter<std::__1::shared_ptr<DB::IAST>*>) @ 0xdef5e7e in /usr/bin/clickhouse
2020.10.26 10:56:31.340957 [ 18476 ] {} <Fatal> BaseDaemon: 3. 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&) @ 0xdeeaeec in /usr/bin/clickhouse
2020.10.26 10:56:31.340979 [ 18476 ] {} <Fatal> BaseDaemon: 4. DB::MySQLInterpreter::InterpreterMySQLDDLQuery<DB::MySQLInterpreter::InterpreterCreateImpl>::execute() @ 0xdb5214c in /usr/bin/clickhouse
2020.10.26 10:56:31.340993 [ 18476 ] {} <Fatal> BaseDaemon: 5. DB::InterpreterExternalDDLQuery::execute() @ 0xdb511d7 in /usr/bin/clickhouse
2020.10.26 10:56:31.341006 [ 18476 ] {} <Fatal> BaseDaemon: 6. ? @ 0xdecaff8 in /usr/bin/clickhouse
2020.10.26 10:56:31.341022 [ 18476 ] {} <Fatal> BaseDaemon: 7. DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool) @ 0xdec9e9d in /usr/bin/clickhouse
2020.10.26 10:56:31.341036 [ 18476 ] {} <Fatal> BaseDaemon: 8. ? @ 0xdb00ba4 in /usr/bin/clickhouse
2020.10.26 10:56:31.341056 [ 18476 ] {} <Fatal> BaseDaemon: 9. ? @ 0xdb16b98 in /usr/bin/clickhouse
2020.10.26 10:56:31.341094 [ 18476 ] {} <Fatal> BaseDaemon: 10. 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&) @ 0xdb1c79e in /usr/bin/clickhouse
2020.10.26 10:56:31.341111 [ 18476 ] {} <Fatal> BaseDaemon: 11. DB::MaterializeMetadata::transaction(DB::MySQLReplication::Position const&, std::__1::function<void ()> const&) @ 0xdb1cc91 in /usr/bin/clickhouse
2020.10.26 10:56:31.341126 [ 18476 ] {} <Fatal> BaseDaemon: 12. DB::MaterializeMySQLSyncThread::prepareSynchronized(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0xdafa7a9 in /usr/bin/clickhouse
2020.10.26 10:56:31.341146 [ 18476 ] {} <Fatal> BaseDaemon: 13. DB::MaterializeMySQLSyncThread::synchronization(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0xdaf9e2a in /usr/bin/clickhouse
2020.10.26 10:56:31.341174 [ 18476 ] {} <Fatal> BaseDaemon: 14. ? @ 0xdb162cd in /usr/bin/clickhouse
2020.10.26 10:56:31.341189 [ 18476 ] {} <Fatal> BaseDaemon: 15. ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0x7b8b75d in /usr/bin/clickhouse
2020.10.26 10:56:31.341203 [ 18476 ] {} <Fatal> BaseDaemon: 16. ? @ 0x7b8f273 in /usr/bin/clickhouse
2020.10.26 10:56:31.341232 [ 18476 ] {} <Fatal> BaseDaemon: 17. start_thread @ 0x82de in /usr/lib64/libpthread-2.28.so
2020.10.26 10:56:31.341254 [ 18476 ] {} <Fatal> BaseDaemon: 18. clone @ 0xfc133 in /usr/lib64/libc-2.28.so
2020.10.26 10:57:13.074460 [ 18605 ] {} <Fatal> BaseDaemon: ########################################
```
{
    tryRegisterFunctions();
    const auto & context_holder = getContext();
    std::vector<std::pair<String, String>> test_types
    {
        {"TINYINT", "Int8"}, {"SMALLINT", "Int16"}, {"MEDIUMINT", "Int32"}, {"INT", "Int32"},
        {"INTEGER", "Int32"}, {"BIGINT", "Int64"}, {"FLOAT", "Float32"}, {"DOUBLE", "Float64"},
        {"VARCHAR(10)", "String"}, {"CHAR(10)", "String"}, {"Date", "Date"}, {"DateTime", "DateTime"},
        {"TIMESTAMP", "DateTime"}, {"BOOLEAN", "Int8"}
    };
    for (const auto & [test_type, mapped_type] : test_types)
    {
        EXPECT_EQ(queryToString(tryRewrittenCreateQuery(
            "CREATE TABLE `test_database`.`test_table_1`(`key` INT NOT NULL PRIMARY KEY, test " + test_type + ")", context_holder.context)),
            "CREATE TABLE test_database.test_table_1 (`key` Int32, `test` Nullable(" + mapped_type + ")"
            ", `_sign` Int8() MATERIALIZED 1, `_version` UInt64() MATERIALIZED 1) ENGINE = "
            "ReplacingMergeTree(_version) PARTITION BY intDiv(key, 4294967) ORDER BY tuple(key)");
        EXPECT_EQ(queryToString(tryRewrittenCreateQuery(
            "CREATE TABLE `test_database`.`test_table_1`(`key` INT NOT NULL PRIMARY KEY, test " + test_type + " NOT NULL)", context_holder.context)),
            "CREATE TABLE test_database.test_table_1 (`key` Int32, `test` " + mapped_type +
            ", `_sign` Int8() MATERIALIZED 1, `_version` UInt64() MATERIALIZED 1) ENGINE = "
            "ReplacingMergeTree(_version) PARTITION BY intDiv(key, 4294967) ORDER BY tuple(key)");
        EXPECT_EQ(queryToString(tryRewrittenCreateQuery(