diff options
author | unknown <gluh@eagle.intranet.mysql.r18.ru> | 2006-06-06 11:25:31 +0500 |
---|---|---|
committer | unknown <gluh@eagle.intranet.mysql.r18.ru> | 2006-06-06 11:25:31 +0500 |
commit | 6c431a5ecdd3f1f94de650217877b9c9b2d9a7ac (patch) | |
tree | 064a35299004f4444c304c020aa29bc9c73d04a2 /sql/sql_show.cc | |
parent | 6a46bf820d3cef208d4bd5986def30a967bd7710 (diff) | |
download | mariadb-git-6c431a5ecdd3f1f94de650217877b9c9b2d9a7ac.tar.gz |
Bug#17661 information_schema.SCHEMATA returns uppercase with lower_case_table_names = 1
fix: return db name for I_S.TABLES(and others) in original letter case.
if mysql starts with lower_case_table_names=1 | 2 then original db name is converted
to lower case(for I_S tables). It happens when we perform add_table_to_list.
to avoid this we make a copy of original db name and use the copy hereafter.
mysql-test/r/lowercase_table2.result:
Bug#17661 information_schema.SCHEMATA returns uppercase with lower_case_table_names = 1
test case
mysql-test/t/lowercase_table2.test:
Bug#17661 information_schema.SCHEMATA returns uppercase with lower_case_table_names = 1
test case
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 246da4dfeec..ca6a8ddfb6b 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2070,7 +2070,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) ST_SCHEMA_TABLE *schema_table= tables->schema_table; SELECT_LEX sel; INDEX_FIELD_VALUES idx_field_vals; - char path[FN_REFLEN], *end, *base_name, *file_name; + char path[FN_REFLEN], *end, *base_name, *orig_base_name, *file_name; uint len; bool with_i_schema; enum enum_schema_tables schema_table_idx; @@ -2150,7 +2150,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) partial_cond= make_cond_for_info_schema(cond, tables); it.rewind(); /* To get access to new elements in basis list */ - while ((base_name= it++) || + while ((orig_base_name= base_name= it++) || /* generate error for non existing database. (to save old behaviour for SHOW TABLES FROM db) @@ -2181,6 +2181,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) if (mysql_find_files(thd, &files, base_name, path, idx_field_vals.table_value, 0)) goto err; + if (lower_case_table_names) + orig_base_name= thd->strdup(base_name); } List_iterator_fast<char> it_files(files); @@ -2249,7 +2251,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) in this case. */ res= schema_table->process_table(thd, show_table_list, table, - res, base_name, + res, orig_base_name, show_table_list->alias); close_tables_for_reopen(thd, &show_table_list); DBUG_ASSERT(!lex->query_tables_own_last); |