| 34 | } |
| 35 | |
| 36 | void DatabaseMemory::createTable( |
| 37 | ContextPtr /*context*/, |
| 38 | const String & table_name, |
| 39 | const StoragePtr & table, |
| 40 | const ASTPtr & query) |
| 41 | { |
| 42 | std::lock_guard lock{mutex}; |
| 43 | attachTableUnlocked(table_name, table); |
| 44 | |
| 45 | /// Clean the query from temporary flags. |
| 46 | ASTPtr query_to_store = query; |
| 47 | if (query) |
| 48 | { |
| 49 | query_to_store = query->clone(); |
| 50 | auto * create = query_to_store->as<ASTCreateQuery>(); |
| 51 | if (!create) |
| 52 | throw Exception(ErrorCodes::LOGICAL_ERROR, "Query '{}' is not CREATE query", query->formatForErrorMessage()); |
| 53 | cleanupObjectDefinitionFromTemporaryFlags(*create); |
| 54 | } |
| 55 | |
| 56 | create_queries.emplace(table_name, query_to_store); |
| 57 | } |
| 58 | |
| 59 | void DatabaseMemory::dropTable( |
| 60 | ContextPtr /*context*/, |
nothing calls this directly
no test coverage detected