summaryrefslogtreecommitdiff
path: root/storage/archive
diff options
context:
space:
mode:
authorAnnamalai Gurusami <annamalai.gurusami@oracle.com>2012-12-20 19:26:20 +0530
committerAnnamalai Gurusami <annamalai.gurusami@oracle.com>2012-12-20 19:26:20 +0530
commitc162202ac06c4659e43fad96f9fe0b2907bef13a (patch)
tree96e4331d47ed5f33927433c56a29cc5d584b4452 /storage/archive
parentc7fd61814f6014e90d90f4919ea4024f77c7e14c (diff)
downloadmariadb-git-c162202ac06c4659e43fad96f9fe0b2907bef13a.tar.gz
Bug #13819630 ARCHIVE TABLE WITH 1000+ PARTITIONS CRASHES SERVER
ON "DROP TABLE" In the function ha_archive::write_row(), there is an error code path that exits the function without releasing the mutex that was acquired earlier. rb#1743 approved by ramil.
Diffstat (limited to 'storage/archive')
-rw-r--r--storage/archive/ha_archive.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 0e186cb8513..164c59f2426 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -898,10 +898,11 @@ int ha_archive::write_row(uchar *buf)
table->timestamp_field->set_time();
mysql_mutex_lock(&share->mutex);
- if (!share->archive_write_open)
- if (init_archive_writer())
- DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
-
+ if (!share->archive_write_open && init_archive_writer())
+ {
+ rc= HA_ERR_CRASHED_ON_USAGE;
+ goto error;
+ }
if (table->next_number_field && record == table->record[0])
{
@@ -980,8 +981,8 @@ int ha_archive::write_row(uchar *buf)
rc= real_write_row(buf, &(share->archive_write));
error:
mysql_mutex_unlock(&share->mutex);
- my_free(read_buf);
-
+ if (read_buf)
+ my_free(read_buf);
DBUG_RETURN(rc);
}