```
select name, value, last_error_message from system.errors where name = 'FILE_DOESNT_EXIST';
0 rows in set. Elapsed: 0.001 sec.

select * from system.tables format Null;
select * from system.tables format Null;
select * from system.tables format Null;

select name, value, last_error_message from system.errors where name = 'FILE_DOESNT_EXIST';
┌─name──────────────┬─value─┬─last_error_message──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ FILE_DOESNT_EXIST │   198 │ Cannot open file /var/lib/clickhouse/store/bff/bff731ca-ed14-404b-bff7-31caed14904b/zeros_mt.sql, errno: 2, strerror: No such file or directory │
└───────────────────┴───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```
if (!create.attach)
        checkMetadataFilenameAvailability(table_name);
    if (create.attach && fs::exists(table_metadata_path))
    {
        ASTPtr ast_detached = parseQueryFromMetadata(log, local_context, table_metadata_path);
        auto & create_detached = ast_detached->as<ASTCreateQuery &>();
        
        if (create.uuid != create_detached.uuid)
            throw Exception(
                    ErrorCodes::TABLE_ALREADY_EXISTS,
                    "Table {}.{} already exist (detached permanently). To attach it back "
                    "you need to use short ATTACH syntax or a full statement with the same UUID",
                    backQuote(getDatabaseName()), backQuote(table_name));
    }
    String table_metadata_tmp_path = table_metadata_path + create_suffix;
    String statement;
    {
        statement = getObjectDefinitionFromCreateQuery(query);
        
        WriteBufferFromFile out(table_metadata_tmp_path, statement.size(), O_WRONLY | O_CREAT | O_EXCL);
        writeString(statement, out);
        out.next();
        if (settings.fsync_metadata)
            out.sync();
        out.close();
    }
    commitCreateTable(create, table, table_metadata_tmp_path, table_metadata_path, local_context);
    removeDetachedPermanentlyFlag(local_context, table_name, table_metadata_path, false);
}
void DatabaseOnDisk::removeDetachedPermanentlyFlag(ContextPtr, const String & table_name, const String & table_metadata_path, bool) const