mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Bug#37402: Mysql cant read partitioned table with capital letter in the name
Problem was that ha_partition had HA_FILE_BASED flag set (since it uses a .par file), but after open it uses the first partitions flags, which results in different case handling for create and for open. Solution was to change the underlying partition name so it was consistent. (Only happens when lower_case_table_names = 2, i.e. Mac OS X and storage engines without HA_FILE_BASED, like InnoDB and Memory.) (Recommit after adding rename of check_lowercase_names to get_canonical_filename, and moved it from handler.h to mysql_priv.h) NOTE: if a mixed case name for a partitioned table was created when lower_case_table_name = 2 it should be renamed or dropped before using the updated version (See bug#37402 for more info)
This commit is contained in:
@@ -1814,8 +1814,8 @@ bool ha_flush_logs(handlerton *db_type)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static const char *check_lowercase_names(handler *file, const char *path,
|
||||
char *tmp_path)
|
||||
const char *get_canonical_filename(handler *file, const char *path,
|
||||
char *tmp_path)
|
||||
{
|
||||
if (lower_case_table_names != 2 || (file->ha_table_flags() & HA_FILE_BASED))
|
||||
return path;
|
||||
@@ -1886,7 +1886,7 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path,
|
||||
! (file=get_new_handler((TABLE_SHARE*)0, thd->mem_root, table_type)))
|
||||
DBUG_RETURN(ENOENT);
|
||||
|
||||
path= check_lowercase_names(file, path, tmp_path);
|
||||
path= get_canonical_filename(file, path, tmp_path);
|
||||
if ((error= file->ha_delete_table(path)) && generate_warning)
|
||||
{
|
||||
/*
|
||||
@@ -3482,7 +3482,7 @@ int ha_create_table(THD *thd, const char *path,
|
||||
if (update_create_info)
|
||||
update_create_info_from_table(create_info, &table);
|
||||
|
||||
name= check_lowercase_names(table.file, share.path.str, name_buff);
|
||||
name= get_canonical_filename(table.file, share.path.str, name_buff);
|
||||
|
||||
error= table.file->ha_create(name, &table, create_info);
|
||||
VOID(closefrm(&table, 0));
|
||||
@@ -3554,7 +3554,7 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name)
|
||||
update_create_info_from_table(&create_info, &table);
|
||||
create_info.table_options|= HA_OPTION_CREATE_FROM_ENGINE;
|
||||
|
||||
check_lowercase_names(table.file, path, path);
|
||||
get_canonical_filename(table.file, path, path);
|
||||
error=table.file->ha_create(path, &table, &create_info);
|
||||
VOID(closefrm(&table, 1));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user