Commit e7165957 authored by marko's avatar marko

branches/zip: Minor fixes for BLOB handling.

page_zip_get_n_prev_extern(): Ignore deleted records.

page_zip_write_rec(): Remove bogus debug assertion about the BLOB pointer
being zero-filled.  It would fail when reallocating records from the page
heap or when updating records in place.
parent 23dc2e55
...@@ -181,7 +181,7 @@ page_zip_dir_get( ...@@ -181,7 +181,7 @@ page_zip_dir_get(
/********************************************************** /**********************************************************
Determine how many externally stored columns are contained Determine how many externally stored columns are contained
in records with smaller heap_no than rec. */ in existing records with smaller heap_no than rec. */
static static
ulint ulint
page_zip_get_n_prev_extern( page_zip_get_n_prev_extern(
...@@ -197,7 +197,7 @@ page_zip_get_n_prev_extern( ...@@ -197,7 +197,7 @@ page_zip_get_n_prev_extern(
ulint i; ulint i;
ulint left; ulint left;
ulint heap_no; ulint heap_no;
ulint n_recs = page_dir_get_n_heap((page_t*) page_zip->data) - 2; ulint n_recs = page_get_n_recs((page_t*) page_zip->data);
ut_ad(page_is_leaf(page)); ut_ad(page_is_leaf(page));
ut_ad(page_is_comp(page)); ut_ad(page_is_comp(page));
...@@ -223,7 +223,6 @@ page_zip_get_n_prev_extern( ...@@ -223,7 +223,6 @@ page_zip_get_n_prev_extern(
} }
} }
ut_a(!left);
return(n_ext); return(n_ext);
} }
...@@ -2044,7 +2043,7 @@ page_zip_write_rec( ...@@ -2044,7 +2043,7 @@ page_zip_write_rec(
ulint blob_no = page_zip_get_n_prev_extern( ulint blob_no = page_zip_get_n_prev_extern(
page_zip, rec, index); page_zip, rec, index);
byte* ext_end = externs - page_zip->n_blobs byte* ext_end = externs - page_zip->n_blobs
* BTR_EXTERN_FIELD_REF_SIZE; * BTR_EXTERN_FIELD_REF_SIZE;
ut_ad(blob_no <= page_zip->n_blobs); ut_ad(blob_no <= page_zip->n_blobs);
externs -= blob_no * BTR_EXTERN_FIELD_REF_SIZE; externs -= blob_no * BTR_EXTERN_FIELD_REF_SIZE;
...@@ -2112,8 +2111,6 @@ page_zip_write_rec( ...@@ -2112,8 +2111,6 @@ page_zip_write_rec(
/* Store the BLOB pointer separately. */ /* Store the BLOB pointer separately. */
externs -= BTR_EXTERN_FIELD_REF_SIZE; externs -= BTR_EXTERN_FIELD_REF_SIZE;
ut_ad(data < externs); ut_ad(data < externs);
ut_ad(!memcmp(externs, zero,
BTR_EXTERN_FIELD_REF_SIZE));
memcpy(externs, src, memcpy(externs, src,
BTR_EXTERN_FIELD_REF_SIZE); BTR_EXTERN_FIELD_REF_SIZE);
} }
......
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