From c162202ac06c4659e43fad96f9fe0b2907bef13a Mon Sep 17 00:00:00 2001 From: Annamalai Gurusami Date: Thu, 20 Dec 2012 19:26:20 +0530 Subject: 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. --- storage/archive/ha_archive.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'storage/archive') 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); } -- cgit v1.2.1