diff options
author | Oleksandr Byelkin <sanja@askmonty.org> | 2011-05-12 14:56:08 +0300 |
---|---|---|
committer | Oleksandr Byelkin <sanja@askmonty.org> | 2011-05-12 14:56:08 +0300 |
commit | 84505e6e3a107e062d1caa20cf7ed63443133ef6 (patch) | |
tree | 32ea206d92b4f97e89a64ac8b1b563602e3e275b | |
parent | 520927a7df486a1a21f87dadd9c5a920bf583917 (diff) | |
download | mariadb-git-84505e6e3a107e062d1caa20cf7ed63443133ef6.tar.gz |
db_name can change case, so we need copy of it for case insensitive FS.
-rw-r--r-- | sql/sql_show.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 09367503448..884d58d3674 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3415,9 +3415,15 @@ 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++)) { - /* db_name can be changed in make_table_list() func */ - LEX_STRING orig_db_name= *db_name; + LEX_STRING orig_db_name; + /* + db_name can be changed in make_table_list() func. + We need copy of db_name because it can change case. + */ + 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, 0, 1, with_i_schema) || |