diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2015-09-08 16:08:08 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2015-09-08 16:23:19 +0300 |
commit | 2c1553e5456c2ea9940a07e7f99b6b5788db7b1b (patch) | |
tree | bd528492a4798cd2444fedcf68a9b75ce9e9781c /storage/innobase | |
parent | de269f2f1f4b4b787c01d25c9c3609351e4b6999 (diff) | |
download | mariadb-git-2c1553e5456c2ea9940a07e7f99b6b5788db7b1b.tar.gz |
MDEV-8774: Test innodb.innodb_bug53290 failures on buildbot
Fixed unsafe reference to null pointer.
Diffstat (limited to 'storage/innobase')
-rw-r--r-- | storage/innobase/include/row0merge.h | 2 | ||||
-rw-r--r-- | storage/innobase/row/row0merge.cc | 29 |
2 files changed, 16 insertions, 15 deletions
diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h index f9243410418..244ed777a4d 100644 --- a/storage/innobase/include/row0merge.h +++ b/storage/innobase/include/row0merge.h @@ -457,5 +457,5 @@ row_merge_read_rec( fil_space_crypt_t* crypt_data,/*!< in: table crypt data */ row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */ ulint space) /*!< in: space id */ - __attribute__((nonnull, warn_unused_result)); + __attribute__((nonnull(1,2,3,4,6,7,8), warn_unused_result)); #endif /* row0merge.h */ diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index b9ef667bec7..b684a3592df 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -2131,7 +2131,7 @@ wait_again: of->fd, &of->offset, \ mrec##N, offsets##N, \ crypt_data, \ - &crypt_block[2 * srv_sort_buf_size], \ + crypt_block ? &crypt_block[2 * srv_sort_buf_size] : NULL , \ space); \ if (UNIV_UNLIKELY(!b2 || ++of->n_rec > file->n_rec)) { \ goto corrupt; \ @@ -2141,7 +2141,7 @@ wait_again: file->fd, foffs##N, \ &mrec##N, offsets##N, \ crypt_data, \ - &crypt_block[N * srv_sort_buf_size], \ + crypt_block ? &crypt_block[N * srv_sort_buf_size] : NULL, \ space); \ \ if (UNIV_UNLIKELY(!b##N)) { \ @@ -2155,7 +2155,7 @@ wait_again: /*************************************************************//** Merge two blocks of records on disk and write a bigger block. @return DB_SUCCESS or error code */ -static __attribute__((nonnull, warn_unused_result)) +static __attribute__((nonnull(1,2,3,4,5,6), warn_unused_result)) dberr_t row_merge_blocks( /*=============*/ @@ -2204,9 +2204,9 @@ row_merge_blocks( file in two halves, which can be merged on the following pass. */ if (!row_merge_read(file->fd, *foffs0, &block[0], - crypt_data, &crypt_block[0], space) + crypt_data, crypt_block ? &crypt_block[0] : NULL, space) || !row_merge_read(file->fd, *foffs1, &block[srv_sort_buf_size], - crypt_data, &crypt_block[srv_sort_buf_size], space)) { + crypt_data, crypt_block ? &crypt_block[srv_sort_buf_size] : NULL, space)) { corrupt: mem_heap_free(heap); return(DB_CORRUPTION); @@ -2219,13 +2219,13 @@ corrupt: b0 = row_merge_read_rec( &block[0], &buf[0], b0, dup->index, file->fd, foffs0, &mrec0, offsets0, - crypt_data, &crypt_block[0], space); + crypt_data, crypt_block ? &crypt_block[0] : NULL, space); b1 = row_merge_read_rec( &block[srv_sort_buf_size], &buf[srv_sort_buf_size], b1, dup->index, file->fd, foffs1, &mrec1, offsets1, - crypt_data, &crypt_block[srv_sort_buf_size], space); + crypt_data, crypt_block ? &crypt_block[srv_sort_buf_size] : NULL, space); if (UNIV_UNLIKELY(!b0 && mrec0) || UNIV_UNLIKELY(!b1 && mrec1)) { @@ -2271,7 +2271,7 @@ done1: b2 = row_merge_write_eof(&block[2 * srv_sort_buf_size], b2, of->fd, &of->offset, - crypt_data, &crypt_block[2 * srv_sort_buf_size], space); + crypt_data, crypt_block ? &crypt_block[2 * srv_sort_buf_size] : NULL, space); return(b2 ? DB_SUCCESS : DB_CORRUPTION); } @@ -2279,7 +2279,7 @@ done1: /*************************************************************//** Copy a block of index entries. @return TRUE on success, FALSE on failure */ -static __attribute__((nonnull, warn_unused_result)) +static __attribute__((nonnull(1,2,3,4,5), warn_unused_result)) ibool row_merge_blocks_copy( /*==================*/ @@ -2318,7 +2318,7 @@ row_merge_blocks_copy( file in two halves, which can be merged on the following pass. */ if (!row_merge_read(file->fd, *foffs0, &block[0], - crypt_data, &crypt_block[0], space)) { + crypt_data, crypt_block ? &crypt_block[0] : NULL, space)) { corrupt: mem_heap_free(heap); return(FALSE); @@ -2330,7 +2330,7 @@ corrupt: b0 = row_merge_read_rec(&block[0], &buf[0], b0, index, file->fd, foffs0, &mrec0, offsets0, - crypt_data, &crypt_block[0], space); + crypt_data, crypt_block ? &crypt_block[0] : NULL, space); if (UNIV_UNLIKELY(!b0 && mrec0)) { @@ -2353,14 +2353,15 @@ done0: return(row_merge_write_eof(&block[2 * srv_sort_buf_size], b2, of->fd, &of->offset, - crypt_data, &crypt_block[2 * srv_sort_buf_size], space) + crypt_data, + crypt_block ? &crypt_block[2 * srv_sort_buf_size] : NULL, space) != NULL); } /*************************************************************//** Merge disk files. @return DB_SUCCESS or error code */ -static __attribute__((nonnull)) +static __attribute__((nonnull(1,2,3,4,5,6,7))) dberr_t row_merge( /*======*/ @@ -2648,7 +2649,7 @@ row_merge_copy_blobs( Read sorted file containing index data tuples and insert these data tuples to the index @return DB_SUCCESS or error number */ -static __attribute__((nonnull, warn_unused_result)) +static __attribute__((nonnull(2,3,5), warn_unused_result)) dberr_t row_merge_insert_index_tuples( /*==========================*/ |