summaryrefslogtreecommitdiff
path: root/storage/archive/ha_archive.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <sergey.vojtovich@oracle.com>2011-05-18 14:01:43 +0400
committerSergey Vojtovich <sergey.vojtovich@oracle.com>2011-05-18 14:01:43 +0400
commitc5dd72b50660701cdba62df8b3c6e32bd1f66872 (patch)
treebc172713c9f315fc333f8624ce8cdb4f9a692ecf /storage/archive/ha_archive.cc
parent91133804d1a800bed4e43c07e8f26d9345c78420 (diff)
downloadmariadb-git-c5dd72b50660701cdba62df8b3c6e32bd1f66872.tar.gz
BUG#12402794 - 60976: CRASH, VALGRIND WARNING AND MEMORY
LEAK WITH PARTITIONED ARCHIVE TABLES CHECK TABLE against archive table, when file descriptors are exhausted, caused server crash. Archive didn't handle errors when opening data file for CHECK TABLE. mysql-test/r/archive_debug.result: A test case for BUG#12402794. mysql-test/t/archive_debug.test: A test case for BUG#12402794. storage/archive/azio.c: A test case for BUG#12402794. storage/archive/ha_archive.cc: Handle init_archive_reader() failure.
Diffstat (limited to 'storage/archive/ha_archive.cc')
-rw-r--r--storage/archive/ha_archive.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index e5c483daac5..4da98507dcf 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -1586,11 +1586,12 @@ int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt)
azflush(&(share->archive_write), Z_SYNC_FLUSH);
pthread_mutex_unlock(&share->mutex);
+ if (init_archive_reader())
+ DBUG_RETURN(HA_ADMIN_CORRUPT);
/*
Now we will rewind the archive file so that we are positioned at the
start of the file.
*/
- init_archive_reader();
read_data_header(&archive);
while (!(rc= get_row(&archive, table->record[0])))
count--;