summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@oracle.com>2013-03-12 13:57:02 +0200
committerMarko Mäkelä <marko.makela@oracle.com>2013-03-12 13:57:02 +0200
commitb5f4385ee387cbcaed859780a95dc7d0b32941f1 (patch)
tree829420858b5760afe58611a8eb8c68997724ec23 /storage
parent8b50ce72f94ab87ebd3334030780769850dd8840 (diff)
parentdaa28126f5740ba88d513f83f13927a56b42addd (diff)
downloadmariadb-git-b5f4385ee387cbcaed859780a95dc7d0b32941f1.tar.gz
Merge mysql-5.1 to mysql-5.5.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/include/page0zip.ic20
-rw-r--r--storage/innobase/page/page0zip.c16
2 files changed, 12 insertions, 24 deletions
diff --git a/storage/innobase/include/page0zip.ic b/storage/innobase/include/page0zip.ic
index b5480604bdf..9e9dda90936 100644
--- a/storage/innobase/include/page0zip.ic
+++ b/storage/innobase/include/page0zip.ic
@@ -229,9 +229,7 @@ ibool
page_zip_get_trailer_len(
/*=====================*/
const page_zip_des_t* page_zip,/*!< in: compressed page */
- ibool is_clust,/*!< in: TRUE if clustered index */
- ulint* entry_size)/*!< out: size of the uncompressed
- portion of a user record */
+ ibool is_clust)/*!< in: TRUE if clustered index */
{
ulint uncompressed_size;
@@ -250,10 +248,6 @@ page_zip_get_trailer_len(
ut_ad(!page_zip->n_blobs);
}
- if (entry_size) {
- *entry_size = uncompressed_size;
- }
-
return((page_dir_get_n_heap(page_zip->data) - 2)
* uncompressed_size
+ page_zip->n_blobs * BTR_EXTERN_FIELD_REF_SIZE);
@@ -270,11 +264,9 @@ page_zip_max_ins_size(
const page_zip_des_t* page_zip,/*!< in: compressed page */
ibool is_clust)/*!< in: TRUE if clustered index */
{
- ulint uncompressed_size;
ulint trailer_len;
- trailer_len = page_zip_get_trailer_len(page_zip, is_clust,
- &uncompressed_size);
+ trailer_len = page_zip_get_trailer_len(page_zip, is_clust);
/* When a record is created, a pointer may be added to
the dense directory.
@@ -283,7 +275,7 @@ page_zip_max_ins_size(
Also the BLOB pointers will be allocated from there, but
we may as well count them in the length of the record. */
- trailer_len += uncompressed_size;
+ trailer_len += PAGE_ZIP_DIR_SLOT_SIZE;
return((lint) page_zip_get_size(page_zip)
- trailer_len - page_zip->m_end
@@ -303,13 +295,11 @@ page_zip_available(
ulint create) /*!< in: nonzero=add the record to
the heap */
{
- ulint uncompressed_size;
ulint trailer_len;
ut_ad(length > REC_N_NEW_EXTRA_BYTES);
- trailer_len = page_zip_get_trailer_len(page_zip, is_clust,
- &uncompressed_size);
+ trailer_len = page_zip_get_trailer_len(page_zip, is_clust);
/* Subtract the fixed extra bytes and add the maximum
space needed for identifying the record (encoded heap_no). */
@@ -323,7 +313,7 @@ page_zip_available(
Also the BLOB pointers will be allocated from there, but
we may as well count them in the length of the record. */
- trailer_len += uncompressed_size;
+ trailer_len += PAGE_ZIP_DIR_SLOT_SIZE;
}
return(UNIV_LIKELY(length
diff --git a/storage/innobase/page/page0zip.c b/storage/innobase/page/page0zip.c
index f9338da079e..a4a357ae44a 100644
--- a/storage/innobase/page/page0zip.c
+++ b/storage/innobase/page/page0zip.c
@@ -2271,13 +2271,12 @@ zlib_done:
if (UNIV_UNLIKELY
(page_zip_get_trailer_len(page_zip,
- dict_index_is_clust(index), NULL)
+ dict_index_is_clust(index))
+ page_zip->m_end >= page_zip_get_size(page_zip))) {
page_zip_fail(("page_zip_decompress_node_ptrs:"
" %lu + %lu >= %lu, %lu\n",
(ulong) page_zip_get_trailer_len(
- page_zip, dict_index_is_clust(index),
- NULL),
+ page_zip, dict_index_is_clust(index)),
(ulong) page_zip->m_end,
(ulong) page_zip_get_size(page_zip),
(ulong) dict_index_is_clust(index)));
@@ -2428,12 +2427,12 @@ zlib_done:
page_zip->m_nonempty = mod_log_ptr != d_stream->next_in;
}
- if (UNIV_UNLIKELY(page_zip_get_trailer_len(page_zip, FALSE, NULL)
+ if (UNIV_UNLIKELY(page_zip_get_trailer_len(page_zip, FALSE)
+ page_zip->m_end >= page_zip_get_size(page_zip))) {
page_zip_fail(("page_zip_decompress_sec: %lu + %lu >= %lu\n",
(ulong) page_zip_get_trailer_len(
- page_zip, FALSE, NULL),
+ page_zip, FALSE),
(ulong) page_zip->m_end,
(ulong) page_zip_get_size(page_zip)));
return(FALSE);
@@ -2759,12 +2758,12 @@ zlib_done:
page_zip->m_nonempty = mod_log_ptr != d_stream->next_in;
}
- if (UNIV_UNLIKELY(page_zip_get_trailer_len(page_zip, TRUE, NULL)
+ if (UNIV_UNLIKELY(page_zip_get_trailer_len(page_zip, TRUE)
+ page_zip->m_end >= page_zip_get_size(page_zip))) {
page_zip_fail(("page_zip_decompress_clust: %lu + %lu >= %lu\n",
(ulong) page_zip_get_trailer_len(
- page_zip, TRUE, NULL),
+ page_zip, TRUE),
(ulong) page_zip->m_end,
(ulong) page_zip_get_size(page_zip)));
return(FALSE);
@@ -4639,8 +4638,7 @@ page_zip_copy_recs(
memcpy(page_zip, src_zip, sizeof *page_zip);
page_zip->data = data;
}
- ut_ad(page_zip_get_trailer_len(page_zip,
- dict_index_is_clust(index), NULL)
+ ut_ad(page_zip_get_trailer_len(page_zip, dict_index_is_clust(index))
+ page_zip->m_end < page_zip_get_size(page_zip));
if (!page_is_leaf(src)