Commit b73c5cdc authored by unknown's avatar unknown

after merge fix

parent 93c01eb1
...@@ -6076,7 +6076,7 @@ my_bool mysql_rm_tmp_tables(void) ...@@ -6076,7 +6076,7 @@ my_bool mysql_rm_tmp_tables(void)
char filePath[FN_REFLEN], *tmpdir, filePathCopy[FN_REFLEN]; char filePath[FN_REFLEN], *tmpdir, filePathCopy[FN_REFLEN];
MY_DIR *dirp; MY_DIR *dirp;
FILEINFO *file; FILEINFO *file;
TABLE tmp_table; TABLE_SHARE share;
THD *thd; THD *thd;
DBUG_ENTER("mysql_rm_tmp_tables"); DBUG_ENTER("mysql_rm_tmp_tables");
...@@ -6108,21 +6108,24 @@ my_bool mysql_rm_tmp_tables(void) ...@@ -6108,21 +6108,24 @@ my_bool mysql_rm_tmp_tables(void)
char *ext= fn_ext(file->name); char *ext= fn_ext(file->name);
uint ext_len= strlen(ext); uint ext_len= strlen(ext);
uint filePath_len= my_snprintf(filePath, sizeof(filePath), uint filePath_len= my_snprintf(filePath, sizeof(filePath),
"%s%c%s", FN_LIBCHAR,tmpdir, "%s%c%s", tmpdir, FN_LIBCHAR,
file->name); file->name);
if (!bcmp(reg_ext, ext, ext_len)) if (!bcmp(reg_ext, ext, ext_len))
{ {
TABLE tmp_table; handler *handler_file= 0;
if (!openfrm(thd, filePath, "tmp_table", (uint) 0, /* We should cut file extention before deleting of table */
READ_KEYINFO | COMPUTE_TYPES | EXTRA_RECORD, memcpy(filePathCopy, filePath, filePath_len - ext_len);
0, &tmp_table)) filePathCopy[filePath_len - ext_len]= 0;
init_tmp_table_share(&share, "", 0, "", filePathCopy);
if (!open_table_def(thd, &share, 0) &&
((handler_file= get_new_handler(&share, thd->mem_root,
share.db_type))))
{ {
/* We should cut file extention before deleting of table */ handler_file->delete_table(filePathCopy);
memcpy(filePathCopy, filePath, filePath_len - ext_len); delete handler_file;
filePathCopy[filePath_len - ext_len]= 0;
tmp_table.file->delete_table(filePathCopy);
closefrm(&tmp_table);
} }
free_table_share(&share);
}
} }
/* /*
File can be already deleted by tmp_table.file->delete_table(). File can be already deleted by tmp_table.file->delete_table().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment