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:
@ -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;
|
||||
|
Reference in New Issue
Block a user