Skip to content

Commit

Permalink
Fix missing of default database (#710)
Browse files Browse the repository at this point in the history
Signed-off-by: JaySon-Huang <[email protected]>

For TiFlash deployed with TiDB cluster, we use "system" as the default database, which always exists in TiFlash.
  • Loading branch information
sre-bot authored May 25, 2020
1 parent 2b72d1f commit 98955eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dbms/src/Server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ int Server::main(const std::vector<std::string> & /*args*/)
const std::string path = all_normal_path[0];
TiFlashRaftConfig raft_config(path, config(), log);
// Use pd address to define which default_database we use by defauly.
// For mock test, we use "default". For deployed with pd/tidb/tikv use "db_1" , whose name is "test" in TiDB.
std::string default_database = config().getString("default_database", raft_config.pd_addrs.empty() ? "default" : "db_1");
// For mock test, we use "default". For deployed with pd/tidb/tikv use "system", which is always exist in TiFlash.
std::string default_database = config().getString("default_database", raft_config.pd_addrs.empty() ? "default" : "system");
global_context->setPath(path);
global_context->initializePartPathSelector(std::move(all_normal_path), std::move(all_fast_path));

Expand Down

0 comments on commit 98955eb

Please sign in to comment.