Commit 7696aaf8 authored by marko's avatar marko

branches/zip: Add some clarifying comments.

btr_copy_blob_prefix(), btr_copy_externally_stored_field_prefix_low():
Document the return value as "number of bytes written", not "bytes written".

trx_undo_page_fetch_ext(): Explain the assertion ut_a(ext_len).

row_build_index_entry(): Explain the assertion ut_a(!ext).
parent d35922d1
......@@ -4278,7 +4278,7 @@ static
ulint
btr_copy_blob_prefix(
/*=================*/
/* out: bytes written to buf */
/* out: number of bytes written to buf */
byte* buf, /* out: the externally stored part of
the field, or a prefix of it */
ulint len, /* in: length of buf, in bytes */
......@@ -4458,7 +4458,7 @@ static
ulint
btr_copy_externally_stored_field_prefix_low(
/*========================================*/
/* out: bytes written to buf */
/* out: number of bytes written to buf */
byte* buf, /* out: the externally stored part of
the field, or a prefix of it */
ulint len, /* in: length of buf, in bytes */
......
......@@ -89,8 +89,10 @@ row_build_index_entry(
entry_len = dict_index_get_n_fields(index);
entry = dtuple_create(heap, entry_len);
if (index->type & DICT_UNIVERSAL) {
if (UNIV_UNLIKELY(index->type & DICT_UNIVERSAL)) {
dtuple_set_n_fields_cmp(entry, entry_len);
/* There may only be externally stored columns
in a clustered index B-tree of a user table. */
ut_a(!ext);
} else {
dtuple_set_n_fields_cmp(
......
......@@ -423,6 +423,7 @@ trx_undo_page_fetch_ext(
/* Fetch the BLOB. */
ulint ext_len = btr_copy_externally_stored_field_prefix(
ext_buf, REC_MAX_INDEX_COL_LEN, zip_size, field, *len);
/* BLOBs should always be nonempty. */
ut_a(ext_len);
/* Append the BLOB pointer to the prefix. */
memcpy(ext_buf + ext_len,
......
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