From adbbbb3c4897f48433250b800aeee01e802f2f15 Mon Sep 17 00:00:00 2001 From: Winter Zhang Date: Fri, 11 May 2018 22:35:32 +0800 Subject: [PATCH] ISSUES-2343 fix failed test (#2344) --- dbms/src/Server/LocalServer.cpp | 8 +++++++- dbms/src/Server/LocalServer.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dbms/src/Server/LocalServer.cpp b/dbms/src/Server/LocalServer.cpp index c1ac861b9bd..77e46cde7eb 100644 --- a/dbms/src/Server/LocalServer.cpp +++ b/dbms/src/Server/LocalServer.cpp @@ -171,7 +171,7 @@ try std::string default_database = config().getString("default_database", "_local"); context->addDatabase(default_database, std::make_shared(default_database)); context->setCurrentDatabase(default_database); - applyCmdSettings(*context); + applyCmdOptions(*context); if (!context->getPath().empty()) { @@ -480,6 +480,12 @@ void LocalServer::init(int argc, char ** argv) config().setBool("ignore-error", true); } +void LocalServer::applyCmdOptions(Context & context) +{ + context.setDefaultFormat(config().getString("output-format", config().getString("format", "TSV"))); + applyCmdSettings(context); +} + } int mainEntryClickHouseLocal(int argc, char ** argv) diff --git a/dbms/src/Server/LocalServer.h b/dbms/src/Server/LocalServer.h index 5aee2739823..5a981216953 100644 --- a/dbms/src/Server/LocalServer.h +++ b/dbms/src/Server/LocalServer.h @@ -36,6 +36,7 @@ private: std::string getInitialCreateTableQuery(); void tryInitPath(); + void applyCmdOptions(Context & context); void applyCmdSettings(Context & context); void attachSystemTables(); void processQueries();