MXS-1820 Show original case in schemarouter SHOW DATABASES queries

Original case is now used in schemarouter this means that database and
table names are now case sensitive as well.
This commit is contained in:
Marko
2018-07-05 09:50:19 +03:00
parent 5b9da16518
commit 0fe5eb2743
2 changed files with 2 additions and 6 deletions

View File

@ -28,21 +28,17 @@ Shard::~Shard()
bool Shard::add_location(std::string db, SERVER* target)
{
std::transform(db.begin(), db.end(), db.begin(), ::tolower);
return m_map.insert(std::make_pair(db, target)).second;
}
void Shard::replace_location(std::string db, SERVER* target)
{
std::transform(db.begin(), db.end(), db.begin(), ::tolower);
m_map[db] = target;
}
SERVER* Shard::get_location(std::string table)
{
SERVER* rval = NULL;
std::transform(table.begin(), table.end(), table.begin(), ::tolower);
if (table.find(".") == std::string::npos)
{
for (ServerMap::iterator it = m_map.begin(); it != m_map.end(); it++)