| 414 | } |
| 415 | |
| 416 | void DatabaseMySQL::loadStoredObjects(ContextMutablePtr, bool, bool /*force_attach*/) |
| 417 | { |
| 418 | |
| 419 | std::lock_guard<std::mutex> lock{mutex}; |
| 420 | fs::directory_iterator iter(getMetadataPath()); |
| 421 | |
| 422 | for (fs::directory_iterator end; iter != end; ++iter) |
| 423 | { |
| 424 | if (fs::is_regular_file(iter->path()) && endsWith(iter->path().filename(), suffix)) |
| 425 | { |
| 426 | const auto & filename = iter->path().filename().string(); |
| 427 | const auto & table_name = unescapeForFileName(filename.substr(0, filename.size() - strlen(suffix))); |
| 428 | remove_or_detach_tables.emplace(table_name); |
| 429 | } |
| 430 | } |
| 431 | } |
| 432 | |
| 433 | void DatabaseMySQL::detachTablePermanently(ContextPtr, const String & table_name) |
| 434 | { |