i use
my steps
1. create a new database ckdb on mysql, then  create table t1(a int, primary key(a)); and insert some rows
2. SET allow_experimental_database_materialize_mysql=1; at clickhouse, 
3. CREATE DATABASE ckdb ENGINE = MaterializeMySQL('127.0.0.1:3306', 'ckdb', 'root', 'A123b_456');
4. use ckdb and select * from t1 ok
5. create table dzm as select * from others in mysql ----> cannot see dzm in clickhouse, but if select * from t1, reports
```
Code: 48. DB::Exception: Received from localhost:9000. DB::Exception: The ckdb.dzm cannot be materialized, because there is no primary keys..
```
6. create table t2(a int,b int primary a);----> cannot see t2 in clickhouse, , but if select * from t1, reports
```
Code: 44. DB::Exception: Received from localhost:9000. DB::Exception: Sorting key cannot contain nullable columns.
```
<del>7. if i drop ckdb and recreate it, all tables can be selected </del>
7.if there are some 'bad' tables in a database, all tables in that database cannot be selected

Make sure to check documentation https://clickhouse.yandex/docs/en/ first. If the question is concise and probably has a short answer, asking it in Telegram chat https://telegram.me/clickhouse_en is probably the fastest way to find the answer. For more complicated questions, consider asking them on StackOverflow with "clickhouse" tag https://stackoverflow.com/questions/tagged/clickhouse 

If you still prefer GitHub issues, remove all this text and ask your question here.

auto storage = std::make_shared<ASTStorage>();
    
    if (ASTPtr partition_expression = getPartitionPolicy(primary_keys))
        storage->set(storage->partition_by, partition_expression);
    
    if (ASTPtr order_by_expression = getOrderByPolicy(primary_keys, unique_keys, keys, increment_columns))
        storage->set(storage->order_by, order_by_expression);
    storage->set(storage->engine, makeASTFunction("ReplacingMergeTree", std::make_shared<ASTIdentifier>(version_column_name)));
    rewritten_query->database = mapped_to_database;
    rewritten_query->table = create_query.table;
    rewritten_query->if_not_exists = create_query.if_not_exists;
    rewritten_query->set(rewritten_query->storage, storage);
    rewritten_query->set(rewritten_query->columns_list, columns);
    return ASTs{rewritten_query};
}
void InterpreterDropImpl::validate(const InterpreterDropImpl::TQuery & , const Context & )
{
}
ASTs InterpreterDropImpl::getRewrittenQueries(
    const InterpreterDropImpl::TQuery & drop_query, const Context & context, const String & mapped_to_database, const String & mysql_database)
{
    const auto & database_name = resolveDatabase(drop_query.database, mysql_database, mapped_to_database, context);
    
    if (database_name != mapped_to_database || drop_query.table.empty() || drop_query.is_view || drop_query.is_dictionary)
        return {};
    ASTPtr rewritten_query = drop_query.clone();
    rewritten_query->as<ASTDropQuery>()->database = mapped_to_database;
    return ASTs{rewritten_query};
}
void InterpreterRenameImpl::validate(const InterpreterRenameImpl::TQuery & rename_query, const Context & )