mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge mysql-test/r/trigger.result: Auto merged mysql-test/t/trigger.test: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/handler.cc: Auto merged sql/item.h: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_partition.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_yacc.yy: Auto merged
This commit is contained in:
@@ -1392,6 +1392,25 @@ bool ha_flush_logs(handlerton *db_type)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static const char *check_lowercase_names(handler *file, const char *path,
|
||||
char *tmp_path)
|
||||
{
|
||||
if (lower_case_table_names != 2 || (file->ha_table_flags() & HA_FILE_BASED))
|
||||
return path;
|
||||
|
||||
/* Ensure that table handler get path in lower case */
|
||||
if (tmp_path != path)
|
||||
strmov(tmp_path, path);
|
||||
|
||||
/*
|
||||
we only should turn into lowercase database/table part
|
||||
so start the process after homedirectory
|
||||
*/
|
||||
my_casedn_str(files_charset_info, tmp_path + mysql_data_home_len);
|
||||
return tmp_path;
|
||||
}
|
||||
|
||||
|
||||
/** @brief
|
||||
This should return ENOENT if the file doesn't exists.
|
||||
The .frm file will be deleted only if we return 0 or ENOENT
|
||||
@@ -1415,13 +1434,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);
|
||||
|
||||
if (lower_case_table_names == 2 && !(file->ha_table_flags() & HA_FILE_BASED))
|
||||
{
|
||||
/* Ensure that table handler get path in lower case */
|
||||
strmov(tmp_path, path);
|
||||
my_casedn_str(files_charset_info, tmp_path);
|
||||
path= tmp_path;
|
||||
}
|
||||
path= check_lowercase_names(file, path, tmp_path);
|
||||
if ((error= file->delete_table(path)) && generate_warning)
|
||||
{
|
||||
/*
|
||||
@@ -2598,15 +2611,7 @@ int ha_create_table(THD *thd, const char *path,
|
||||
if (update_create_info)
|
||||
update_create_info_from_table(create_info, &table);
|
||||
|
||||
name= share.path.str;
|
||||
if (lower_case_table_names == 2 &&
|
||||
!(table.file->ha_table_flags() & HA_FILE_BASED))
|
||||
{
|
||||
/* Ensure that handler gets name in lower case */
|
||||
strmov(name_buff, name);
|
||||
my_casedn_str(files_charset_info, name_buff);
|
||||
name= name_buff;
|
||||
}
|
||||
name= check_lowercase_names(table.file, share.path.str, name_buff);
|
||||
|
||||
error= table.file->create(name, &table, create_info);
|
||||
VOID(closefrm(&table, 0));
|
||||
@@ -2656,7 +2661,8 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name)
|
||||
frmblob and frmlen are set, write the frm to disk
|
||||
*/
|
||||
|
||||
(void)strxnmov(path,FN_REFLEN-1,mysql_data_home,"/",db,"/",name,NullS);
|
||||
(void)strxnmov(path,FN_REFLEN-1,mysql_data_home,FN_ROOTDIR,
|
||||
db,FN_ROOTDIR,name,NullS);
|
||||
// Save the frm file
|
||||
error= writefrm(path, frmblob, frmlen);
|
||||
my_free(frmblob, MYF(0));
|
||||
@@ -2677,12 +2683,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;
|
||||
|
||||
if (lower_case_table_names == 2 &&
|
||||
!(table.file->ha_table_flags() & HA_FILE_BASED))
|
||||
{
|
||||
/* Ensure that handler gets name in lower case */
|
||||
my_casedn_str(files_charset_info, path);
|
||||
}
|
||||
check_lowercase_names(table.file, path, path);
|
||||
error=table.file->create(path,&table,&create_info);
|
||||
VOID(closefrm(&table, 1));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user