summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-04-06 18:11:43 +0300
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-04-06 18:11:43 +0300
commit83ed55df0abea02820939157dd5b4ceb0f23c835 (patch)
tree956f591f1471936bd76e356df7b0dcb321c350ed /sql/sql_show.cc
parenta16fa714e62e7201c8422772eb5c0ef42b4dfccc (diff)
parent19332ed7b9011e4692d27ff59b912eec385dfc33 (diff)
downloadmariadb-git-83ed55df0abea02820939157dd5b4ceb0f23c835.tar.gz
merge mysql-5.1->mysql-5.5
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index a93f06d9409..464b966e4be 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -3556,6 +3556,12 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
it.rewind(); /* To get access to new elements in basis list */
while ((db_name= it++))
{
+ LEX_STRING orig_db_name;
+
+ /* db_name can be changed in make_table_list() func */
+ if (!thd->make_lex_string(&orig_db_name, db_name->str,
+ db_name->length, FALSE))
+ goto err;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (!(check_access(thd, SELECT_ACL, db_name->str,
&thd->col_access, NULL, 0, 1) ||
@@ -3620,17 +3626,13 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
}
int res;
- LEX_STRING tmp_lex_string, orig_db_name;
+ LEX_STRING tmp_lex_string;
/*
Set the parent lex of 'sel' because it is needed by
sel.init_query() which is called inside make_table_list.
*/
thd->no_warnings_for_error= 1;
sel.parent_lex= lex;
- /* db_name can be changed in make_table_list() func */
- if (!thd->make_lex_string(&orig_db_name, db_name->str,
- db_name->length, FALSE))
- goto err;
if (make_table_list(thd, &sel, db_name, table_name))
goto err;
TABLE_LIST *show_table_list= sel.table_list.first;