summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorSatya Bodapati <satya.bodapati@oracle.com>2013-01-04 17:30:39 +0530
committerSatya Bodapati <satya.bodapati@oracle.com>2013-01-04 17:30:39 +0530
commiteab9f8f4f40a5deb7012a53b35ec5ffaf5ec49d9 (patch)
treea97eed3c46ff4f58405c9f4b7faa1bc009d2f151 /storage
parent1ef420b8d4a160a6e1a1a7e8f4dee5f85d2c80d5 (diff)
downloadmariadb-git-eab9f8f4f40a5deb7012a53b35ec5ffaf5ec49d9.tar.gz
Post Fix to Bug#14628410 - ASSERTION `! IS_SET()' FAILED IN
DIAGNOSTICS_AREA::SET_OK_STATUS Test fails on 5.1 valgrind build. This is because of close(-1) system call. Fixed by adding extra checks for valid file descriptor. Approved by Vasil(Calvin). rb#1792
Diffstat (limited to 'storage')
-rw-r--r--storage/innodb_plugin/row/row0merge.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/storage/innodb_plugin/row/row0merge.c b/storage/innodb_plugin/row/row0merge.c
index 204fecbba75..63e14e6568f 100644
--- a/storage/innodb_plugin/row/row0merge.c
+++ b/storage/innodb_plugin/row/row0merge.c
@@ -2642,6 +2642,14 @@ row_merge_build_indexes(
block_size = 3 * sizeof *block;
block = os_mem_alloc_large(&block_size);
+ /* Initialize all the merge file descriptors, so that we
+ don't call row_merge_file_destroy() on uninitialized
+ merge file descriptor */
+
+ for (i = 0; i < n_indexes; i++) {
+ merge_files[i].fd = -1;
+ }
+
for (i = 0; i < n_indexes; i++) {
if (row_merge_file_create(&merge_files[i]) < 0)
@@ -2699,7 +2707,9 @@ row_merge_build_indexes(
}
func_exit:
- close(tmpfd);
+ if (tmpfd >= 0) {
+ close(tmpfd);
+ }
for (i = 0; i < n_indexes; i++) {
row_merge_file_destroy(&merge_files[i]);