summaryrefslogtreecommitdiff
path: root/sql/ha_archive.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/ha_archive.cc')
-rw-r--r--sql/ha_archive.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/sql/ha_archive.cc b/sql/ha_archive.cc
index e3f979952e0..f0c59f131b9 100644
--- a/sql/ha_archive.cc
+++ b/sql/ha_archive.cc
@@ -380,10 +380,8 @@ int ha_archive::write_meta_file(File meta_file, ha_rows rows, bool dirty)
See ha_example.cc for a longer description.
*/
-ARCHIVE_SHARE *ha_archive::get_share(const char *table_name,
- TABLE *table, int *rc)
+ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc)
{
- ARCHIVE_SHARE *share;
char meta_file_name[FN_REFLEN];
uint length;
char *tmp_name;
@@ -411,8 +409,10 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name,
share->table_name= tmp_name;
share->crashed= FALSE;
share->archive_write_open= FALSE;
- fn_format(share->data_file_name,table_name,"",ARZ,MY_REPLACE_EXT|MY_UNPACK_FILENAME);
- fn_format(meta_file_name,table_name,"",ARM,MY_REPLACE_EXT|MY_UNPACK_FILENAME);
+ fn_format(share->data_file_name,table_name,"",ARZ,
+ MY_REPLACE_EXT|MY_UNPACK_FILENAME);
+ fn_format(meta_file_name,table_name,"",ARM,
+ MY_REPLACE_EXT|MY_UNPACK_FILENAME);
strmov(share->table_name,table_name);
/*
We will use this lock for rows.
@@ -448,7 +448,7 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name,
Free the share.
See ha_example.cc for a description.
*/
-int ha_archive::free_share(ARCHIVE_SHARE *share)
+int ha_archive::free_share()
{
int rc= 0;
DBUG_ENTER("ha_archive::free_share");
@@ -528,12 +528,14 @@ int ha_archive::open(const char *name, int mode, uint open_options)
DBUG_PRINT("info", ("archive table was opened for crash %s",
(open_options & HA_OPEN_FOR_REPAIR) ? "yes" : "no"));
- share= get_share(name, table, &rc);
+ share= get_share(name, &rc);
if (rc == HA_ERR_CRASHED_ON_USAGE && !(open_options & HA_OPEN_FOR_REPAIR))
{
- free_share(share);
+ /* purecov: begin inspected */
+ free_share();
DBUG_RETURN(rc);
+ /* purecov: end */
}
else if (rc == HA_ERR_OUT_OF_MEM)
{
@@ -586,7 +588,7 @@ int ha_archive::close(void)
if (gzclose(archive) == Z_ERRNO)
rc= 1;
/* then also close share */
- rc|= free_share(share);
+ rc|= free_share();
DBUG_RETURN(rc);
}