1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug#25081 SHOW FULL TABLES on table with latin chars in name fails

Problem: The Table_type column of "SHOW FULL TABLES" displayed
"ERROR" instead of "BASE TABLE" for tables having non-ascii
characters in their names.
Reason: tablename to filename encoding was missing, so
mysql_frm_type() tried to open a wrong file name.

Fix: adding tablename to filename encoding


mysql-test/r/show_check.result:
  Adding test case
mysql-test/t/show_check.test:
  Adding test case
sql/sql_show.cc:
  Adding tablename to filename encoding.
  Removing variable "end" with is not used anymore.
This commit is contained in:
unknown
2007-01-23 14:32:10 +04:00
parent e1b0f07c74
commit 6a7933cd84
3 changed files with 24 additions and 4 deletions

View File

@ -2490,7 +2490,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, *orig_base_name, *file_name;
char path[FN_REFLEN], *base_name, *orig_base_name, *file_name;
uint len;
bool with_i_schema;
enum enum_schema_tables schema_table_idx;
@ -2507,7 +2507,6 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
lex->view_prepare_mode= TRUE;
DBUG_ENTER("get_all_tables");
LINT_INIT(end);
LINT_INIT(len);
lex->reset_n_backup_query_tables_list(&query_tables_list_backup);
@ -2598,7 +2597,6 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
else
{
len= build_table_filename(path, sizeof(path), base_name, "", "", 0);
end= path + len;
len= FN_LEN - len;
find_files_result res= find_files(thd, &files, base_name,
path, idx_field_vals.table_value, 0);
@ -2648,7 +2646,9 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
}
else
{
my_snprintf(end, len, "/%s%s", file_name, reg_ext);
build_table_filename(path, sizeof(path),
base_name, file_name, reg_ext, 0);
switch (mysql_frm_type(thd, path, &not_used)) {
case FRMTYPE_ERROR:
table->field[3]->store(STRING_WITH_LEN("ERROR"),