MXS-2690: Fix duplicate database detection

Empty duplicate databases are now correctly detected since the results
will always return the database name combined with a trailing period.
This commit is contained in:
Markus Mäkelä
2019-09-20 09:02:53 +03:00
parent 19487d2bfb
commit 9ce788ff0b

View File

@ -1378,7 +1378,7 @@ void SchemaRouterSession::query_databases()
m_state |= INIT_MAPPING;
m_state &= ~INIT_UNINT;
GWBUF* buffer = modutil_create_query("SELECT schema_name FROM information_schema.schemata AS s "
GWBUF* buffer = modutil_create_query("SELECT CONCAT(schema_name, '.') FROM information_schema.schemata AS s "
"LEFT JOIN information_schema.tables AS t ON s.schema_name = t.table_schema "
"WHERE t.table_name IS NULL "
"UNION "