mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
Merge
sql/examples/ha_archive.cc: SCCS merged sql/examples/ha_archive.h: SCCS merged sql/handler.cc: SCCS merged
This commit is contained in:
commit
aba91fb130
3 changed files with 9 additions and 35 deletions
|
|
@ -447,35 +447,6 @@ const char **ha_archive::bas_ext() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
Rename all files that this handler defines in bas_ext list
|
|
||||||
|
|
||||||
NOTE Don't care if the .arn file is missing
|
|
||||||
*/
|
|
||||||
int ha_archive::rename_table(const char * from, const char * to)
|
|
||||||
{
|
|
||||||
DBUG_ENTER("ha_archive::rename_table");
|
|
||||||
DBUG_PRINT("enter", ("from: %s, to: %s", from, to));
|
|
||||||
for (const char **ext=bas_ext(); *ext ; ext++)
|
|
||||||
{
|
|
||||||
// Check if the .arn file exists before rename
|
|
||||||
if (!my_strcasecmp(system_charset_info, *ext, ARN))
|
|
||||||
{
|
|
||||||
char name[FN_REFLEN];
|
|
||||||
(void)strxnmov(name, FN_REFLEN, from, ARN, NullS);
|
|
||||||
if (access(name, F_OK))
|
|
||||||
{
|
|
||||||
DBUG_PRINT("info", ("%s does not exist on disk, skipping it", name));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (rename_file_ext(from,to,*ext))
|
|
||||||
DBUG_RETURN(my_errno);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
When opening a file we:
|
When opening a file we:
|
||||||
Create/get our shared structure.
|
Create/get our shared structure.
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,6 @@ public:
|
||||||
int end_bulk_insert();
|
int end_bulk_insert();
|
||||||
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
|
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
|
||||||
enum thr_lock_type lock_type);
|
enum thr_lock_type lock_type);
|
||||||
int rename_table(const char * from, const char * to);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
handlerton *archive_db_init(void);
|
handlerton *archive_db_init(void);
|
||||||
|
|
|
||||||
|
|
@ -1772,13 +1772,17 @@ int handler::delete_table(const char *name)
|
||||||
|
|
||||||
int handler::rename_table(const char * from, const char * to)
|
int handler::rename_table(const char * from, const char * to)
|
||||||
{
|
{
|
||||||
DBUG_ENTER("handler::rename_table");
|
int error= 0;
|
||||||
for (const char **ext=bas_ext(); *ext ; ext++)
|
for (const char **ext= bas_ext(); *ext ; ext++)
|
||||||
{
|
{
|
||||||
if (rename_file_ext(from,to,*ext))
|
if (rename_file_ext(from, to, *ext))
|
||||||
DBUG_RETURN(my_errno);
|
{
|
||||||
|
if ((error=my_errno) != ENOENT)
|
||||||
|
break;
|
||||||
|
error= 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DBUG_RETURN(0);
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue