From 056f792a1b50f1a3524f0171eb982284f59d2b24 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 24 Sep 2015 22:33:16 +0300 Subject: [PATCH] dbms: little better [#METR-18133]. --- dbms/src/Interpreters/loadMetadata.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dbms/src/Interpreters/loadMetadata.cpp b/dbms/src/Interpreters/loadMetadata.cpp index 76652d43a7d..6ee2df1b912 100644 --- a/dbms/src/Interpreters/loadMetadata.cpp +++ b/dbms/src/Interpreters/loadMetadata.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -75,9 +76,10 @@ void loadMetadata(Context & context) if (it.name().at(0) == '.') continue; - LOG_INFO(log, "Loading database " << it.name()); + String database = unescapeForFileName(it.name()); - executeCreateQuery("ATTACH DATABASE " + it.name(), context, it.name(), it->path()); + LOG_INFO(log, "Loading database " << database); + executeCreateQuery("ATTACH DATABASE " + backQuoteIfNeed(database), context, database, it->path()); /// Цикл по таблицам typedef std::vector Tables; @@ -135,7 +137,7 @@ void loadMetadata(Context & context) try { - executeCreateQuery(s, context, it.name(), tables[j]); + executeCreateQuery(s, context, database, tables[j]); } catch (const Exception & e) {