MXS-942: Don't return information_schema as the parsed database

When a DESCRIBE <table> or a SHOW COLUMNS IN <table> query is done, the
actual query is performed on tables in the information_schema
database. This might be what actually happens on the backend server but
this information is not really useful when we need to know which database
the query targets.

By passing the actual table names instead of the underlying table names,
the schemarouter is able to detect where these statements should be
routed.
This commit is contained in:
Markus Makela
2016-10-21 00:34:21 +03:00
parent 8e9012f514
commit d53a6d2899
3 changed files with 28 additions and 8 deletions

View File

@ -3010,13 +3010,17 @@ like_or_where_opt ::= WHERE expr.
%type show {MxsShow}
show(A) ::= SHOW full_opt(X) COLUMNS from_or_in nm(Y) dbnm(Z) from_or_in_db_opt like_or_where_opt . {
show(A) ::= SHOW full_opt(X) COLUMNS from_or_in nm(Y) dbnm(Z) from_or_in_db_opt(W) like_or_where_opt . {
A.what = MXS_SHOW_COLUMNS;
A.data = X;
if (Z.z) {
A.pName = &Z;
A.pDatabase = &Y;
}
else if (W.z) {
A.pName = &Y;
A.pDatabase = &W;
}
else {
A.pName = &Y;
A.pDatabase = NULL;