Commit 090ea1f8 authored by Annamalai Gurusami's avatar Annamalai Gurusami

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.
parent 7b145111
......@@ -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);
}
......
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