Commit 8919884f authored by marko's avatar marko

branches/zip: Remove some more casts.

dict_index_get_nth_col_pos(), dict_index_get_sys_col_pos(),
dict_index_get_n_fields(), fil_page_get_type():
Add const qualifier to parameter.

dict_index_get_nth_field(): Implement as a macro unless #ifdef UNIV_DEBUG.
parent fbe4fe60
...@@ -544,10 +544,11 @@ Looks for column n in an index. */ ...@@ -544,10 +544,11 @@ Looks for column n in an index. */
ulint ulint
dict_index_get_nth_col_pos( dict_index_get_nth_col_pos(
/*=======================*/ /*=======================*/
/* out: position in internal representation /* out: position in internal
of the index; if not contained, returns representation of the index;
if not contained, returns
ULINT_UNDEFINED */ ULINT_UNDEFINED */
dict_index_t* index, /* in: index */ const dict_index_t* index, /* in: index */
ulint n) /* in: column number */ ulint n) /* in: column number */
{ {
const dict_field_t* field; const dict_field_t* field;
...@@ -1786,8 +1787,7 @@ dict_index_build_internal_clust( ...@@ -1786,8 +1787,7 @@ dict_index_build_internal_clust(
there */ there */
for (i = 0; i + DATA_N_SYS_COLS < (ulint) table->n_cols; i++) { for (i = 0; i + DATA_N_SYS_COLS < (ulint) table->n_cols; i++) {
dict_col_t* col = (dict_col_t*) dict_col_t* col = dict_table_get_nth_col(table, i);
dict_table_get_nth_col(table, i);
ut_ad(col->mtype != DATA_SYS); ut_ad(col->mtype != DATA_SYS);
if (!indexed[col->ind]) { if (!indexed[col->ind]) {
......
...@@ -746,8 +746,7 @@ eval_predefined( ...@@ -746,8 +746,7 @@ eval_predefined(
} }
} }
dfield_set_len((dfield_t*) que_node_get_val(func_node), dfield_set_len(que_node_get_val(func_node), int_len);
int_len);
return; return;
......
...@@ -4719,9 +4719,10 @@ Gets the file page type. */ ...@@ -4719,9 +4719,10 @@ Gets the file page type. */
ulint ulint
fil_page_get_type( fil_page_get_type(
/*==============*/ /*==============*/
/* out: type; NOTE that if the type has not been /* out: type; NOTE that if the type
written to page, the return value not defined */ has not been written to page, the return value
byte* page) /* in: file page */ not defined */
const byte* page) /* in: file page */
{ {
ut_ad(page); ut_ad(page);
......
...@@ -674,8 +674,9 @@ ulint ...@@ -674,8 +674,9 @@ ulint
dict_index_get_n_fields( dict_index_get_n_fields(
/*====================*/ /*====================*/
/* out: number of fields */ /* out: number of fields */
dict_index_t* index); /* in: an internal representation of index const dict_index_t* index); /* in: an internal
(in the dictionary cache) */ representation of index (in
the dictionary cache) */
/************************************************************************ /************************************************************************
Gets the number of fields in the internal representation of an index Gets the number of fields in the internal representation of an index
that uniquely determine the position of an index entry in the index, if that uniquely determine the position of an index entry in the index, if
...@@ -711,6 +712,7 @@ dict_index_get_n_ordering_defined_by_user( ...@@ -711,6 +712,7 @@ dict_index_get_n_ordering_defined_by_user(
/* out: number of fields */ /* out: number of fields */
dict_index_t* index); /* in: an internal representation of index dict_index_t* index); /* in: an internal representation of index
(in the dictionary cache) */ (in the dictionary cache) */
#ifdef UNIV_DEBUG
/************************************************************************ /************************************************************************
Gets the nth field of an index. */ Gets the nth field of an index. */
UNIV_INLINE UNIV_INLINE
...@@ -718,8 +720,11 @@ dict_field_t* ...@@ -718,8 +720,11 @@ dict_field_t*
dict_index_get_nth_field( dict_index_get_nth_field(
/*=====================*/ /*=====================*/
/* out: pointer to field object */ /* out: pointer to field object */
dict_index_t* index, /* in: index */ const dict_index_t* index, /* in: index */
ulint pos); /* in: position of field */ ulint pos); /* in: position of field */
#else /* UNIV_DEBUG */
# define dict_index_get_nth_field(index, pos) ((index)->fields + (pos))
#endif /* UNIV_DEBUG */
/************************************************************************ /************************************************************************
Gets pointer to the nth column in an index. */ Gets pointer to the nth column in an index. */
UNIV_INLINE UNIV_INLINE
...@@ -744,10 +749,11 @@ Looks for column n in an index. */ ...@@ -744,10 +749,11 @@ Looks for column n in an index. */
ulint ulint
dict_index_get_nth_col_pos( dict_index_get_nth_col_pos(
/*=======================*/ /*=======================*/
/* out: position in internal representation /* out: position in internal
of the index; if not contained, returns representation of the index;
if not contained, returns
ULINT_UNDEFINED */ ULINT_UNDEFINED */
dict_index_t* index, /* in: index */ const dict_index_t* index, /* in: index */
ulint n); /* in: column number */ ulint n); /* in: column number */
/************************************************************************ /************************************************************************
Returns TRUE if the index contains a column or a prefix of that column. */ Returns TRUE if the index contains a column or a prefix of that column. */
...@@ -790,9 +796,9 @@ UNIV_INLINE ...@@ -790,9 +796,9 @@ UNIV_INLINE
ulint ulint
dict_index_get_sys_col_pos( dict_index_get_sys_col_pos(
/*=======================*/ /*=======================*/
/* out: position, ULINT_UNDEFINED if not /* out: position,
contained */ ULINT_UNDEFINED if not contained */
dict_index_t* index, /* in: index */ const dict_index_t* index, /* in: index */
ulint type); /* in: DATA_ROW_ID, ... */ ulint type); /* in: DATA_ROW_ID, ... */
/*********************************************************************** /***********************************************************************
Adds a column to index. */ Adds a column to index. */
......
...@@ -316,8 +316,9 @@ ulint ...@@ -316,8 +316,9 @@ ulint
dict_index_get_n_fields( dict_index_get_n_fields(
/*====================*/ /*====================*/
/* out: number of fields */ /* out: number of fields */
dict_index_t* index) /* in: an internal representation of index const dict_index_t* index) /* in: an internal
(in the dictionary cache) */ representation of index (in
the dictionary cache) */
{ {
ut_ad(index); ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
...@@ -385,6 +386,7 @@ dict_index_get_n_ordering_defined_by_user( ...@@ -385,6 +386,7 @@ dict_index_get_n_ordering_defined_by_user(
return(index->n_user_defined_cols); return(index->n_user_defined_cols);
} }
#ifdef UNIV_DEBUG
/************************************************************************ /************************************************************************
Gets the nth field of an index. */ Gets the nth field of an index. */
UNIV_INLINE UNIV_INLINE
...@@ -392,15 +394,16 @@ dict_field_t* ...@@ -392,15 +394,16 @@ dict_field_t*
dict_index_get_nth_field( dict_index_get_nth_field(
/*=====================*/ /*=====================*/
/* out: pointer to field object */ /* out: pointer to field object */
dict_index_t* index, /* in: index */ const dict_index_t* index, /* in: index */
ulint pos) /* in: position of field */ ulint pos) /* in: position of field */
{ {
ut_ad(index); ut_ad(index);
ut_ad(pos < index->n_def); ut_ad(pos < index->n_def);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return((index->fields) + pos); return((dict_field_t*) (index->fields) + pos);
} }
#endif /* UNIV_DEBUG */
/************************************************************************ /************************************************************************
Returns the position of a system column in an index. */ Returns the position of a system column in an index. */
...@@ -408,9 +411,9 @@ UNIV_INLINE ...@@ -408,9 +411,9 @@ UNIV_INLINE
ulint ulint
dict_index_get_sys_col_pos( dict_index_get_sys_col_pos(
/*=======================*/ /*=======================*/
/* out: position, ULINT_UNDEFINED if not /* out: position,
contained */ ULINT_UNDEFINED if not contained */
dict_index_t* index, /* in: index */ const dict_index_t* index, /* in: index */
ulint type) /* in: DATA_ROW_ID, ... */ ulint type) /* in: DATA_ROW_ID, ... */
{ {
ut_ad(index); ut_ad(index);
...@@ -451,8 +454,7 @@ dict_index_get_nth_col( ...@@ -451,8 +454,7 @@ dict_index_get_nth_col(
const dict_index_t* index, /* in: index */ const dict_index_t* index, /* in: index */
ulint pos) /* in: position of the field */ ulint pos) /* in: position of the field */
{ {
return(dict_field_get_col(dict_index_get_nth_field((dict_index_t*) return(dict_field_get_col(dict_index_get_nth_field(index, pos)));
index, pos)));
} }
/************************************************************************ /************************************************************************
......
...@@ -679,9 +679,10 @@ Gets the file page type. */ ...@@ -679,9 +679,10 @@ Gets the file page type. */
ulint ulint
fil_page_get_type( fil_page_get_type(
/*==============*/ /*==============*/
/* out: type; NOTE that if the type has not been /* out: type; NOTE that if the type
written to page, the return value not defined */ has not been written to page, the
byte* page); /* in: file page */ return value not defined */
const byte* page); /* in: file page */
typedef struct fil_space_struct fil_space_t; typedef struct fil_space_struct fil_space_t;
......
...@@ -170,7 +170,7 @@ page_zip_get_trailer_len( ...@@ -170,7 +170,7 @@ page_zip_get_trailer_len(
ut_ad(page_zip_simple_validate(page_zip)); ut_ad(page_zip_simple_validate(page_zip));
if (UNIV_UNLIKELY(!page_is_leaf((page_t*) page_zip->data))) { if (UNIV_UNLIKELY(!page_is_leaf(page_zip->data))) {
uncompressed_size = PAGE_ZIP_DIR_SLOT_SIZE uncompressed_size = PAGE_ZIP_DIR_SLOT_SIZE
+ REC_NODE_PTR_SIZE; + REC_NODE_PTR_SIZE;
ut_ad(!page_zip->n_blobs); ut_ad(!page_zip->n_blobs);
...@@ -186,7 +186,7 @@ page_zip_get_trailer_len( ...@@ -186,7 +186,7 @@ page_zip_get_trailer_len(
*entry_size = uncompressed_size; *entry_size = uncompressed_size;
} }
return((page_dir_get_n_heap((page_t*) page_zip->data) - 2) return((page_dir_get_n_heap(page_zip->data) - 2)
* uncompressed_size * uncompressed_size
+ page_zip->n_blobs * BTR_EXTERN_FIELD_REF_SIZE); + page_zip->n_blobs * BTR_EXTERN_FIELD_REF_SIZE);
} }
...@@ -263,7 +263,7 @@ page_zip_alloc( ...@@ -263,7 +263,7 @@ page_zip_alloc(
ulint create, /* in: nonzero=add the record to the heap */ ulint create, /* in: nonzero=add the record to the heap */
mtr_t* mtr) /* in: mini-transaction, or NULL */ mtr_t* mtr) /* in: mini-transaction, or NULL */
{ {
ut_ad(page_is_comp((page_t*) page)); ut_ad(page_is_comp(page));
#ifdef UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, page)); ut_a(page_zip_validate(page_zip, page));
#endif /* UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
......
...@@ -89,7 +89,7 @@ page_zip_dir_size( ...@@ -89,7 +89,7 @@ page_zip_dir_size(
{ {
/* Exclude the page infimum and supremum from the record count. */ /* Exclude the page infimum and supremum from the record count. */
ulint size = PAGE_ZIP_DIR_SLOT_SIZE ulint size = PAGE_ZIP_DIR_SLOT_SIZE
* (page_dir_get_n_heap((page_t*) page_zip->data) - 2); * (page_dir_get_n_heap(page_zip->data) - 2);
return(size); return(size);
} }
...@@ -106,7 +106,7 @@ page_zip_dir_user_size( ...@@ -106,7 +106,7 @@ page_zip_dir_user_size(
const page_zip_des_t* page_zip) /* in: compressed page */ const page_zip_des_t* page_zip) /* in: compressed page */
{ {
ulint size = PAGE_ZIP_DIR_SLOT_SIZE ulint size = PAGE_ZIP_DIR_SLOT_SIZE
* page_get_n_recs((page_t*) page_zip->data); * page_get_n_recs(page_zip->data);
ut_ad(size <= page_zip_dir_size(page_zip)); ut_ad(size <= page_zip_dir_size(page_zip));
return(size); return(size);
} }
...@@ -271,12 +271,12 @@ page_zip_get_n_prev_extern( ...@@ -271,12 +271,12 @@ page_zip_get_n_prev_extern(
on a B-tree leaf page */ on a B-tree leaf page */
dict_index_t* index) /* in: record descriptor */ dict_index_t* index) /* in: record descriptor */
{ {
page_t* page = page_align((rec_t*) rec); const page_t* page = page_align((rec_t*) rec);
ulint n_ext = 0; ulint n_ext = 0;
ulint i; ulint i;
ulint left; ulint left;
ulint heap_no; ulint heap_no;
ulint n_recs = page_get_n_recs((page_t*) page_zip->data); ulint n_recs = page_get_n_recs(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));
...@@ -291,7 +291,7 @@ page_zip_get_n_prev_extern( ...@@ -291,7 +291,7 @@ page_zip_get_n_prev_extern(
} }
for (i = 0; i < n_recs; i++) { for (i = 0; i < n_recs; i++) {
rec_t* r = page + (page_zip_dir_get(page_zip, i) const rec_t* r = page + (page_zip_dir_get(page_zip, i)
& PAGE_ZIP_DIR_SLOT_MASK); & PAGE_ZIP_DIR_SLOT_MASK);
if (rec_get_heap_no_new(r) < heap_no) { if (rec_get_heap_no_new(r) < heap_no) {
...@@ -475,7 +475,7 @@ page_zip_dir_encode( ...@@ -475,7 +475,7 @@ page_zip_dir_encode(
out: dense page directory sorted by ascending out: dense page directory sorted by ascending
address (and heap_no) */ address (and heap_no) */
{ {
byte* rec; const byte* rec;
ulint status; ulint status;
ulint min_mark; ulint min_mark;
ulint heap_no; ulint heap_no;
...@@ -495,12 +495,12 @@ page_zip_dir_encode( ...@@ -495,12 +495,12 @@ page_zip_dir_encode(
} }
} }
n_heap = page_dir_get_n_heap((page_t*) page); n_heap = page_dir_get_n_heap(page);
/* Traverse the list of stored records in the collation order, /* Traverse the list of stored records in the collation order,
starting from the first user record. */ starting from the first user record. */
rec = (page_t*) page + PAGE_NEW_INFIMUM, TRUE; rec = page + PAGE_NEW_INFIMUM, TRUE;
i = 0; i = 0;
...@@ -510,7 +510,7 @@ page_zip_dir_encode( ...@@ -510,7 +510,7 @@ page_zip_dir_encode(
if (UNIV_UNLIKELY(offs == PAGE_NEW_SUPREMUM)) { if (UNIV_UNLIKELY(offs == PAGE_NEW_SUPREMUM)) {
break; break;
} }
rec = (page_t*) page + offs; rec = page + offs;
heap_no = rec_get_heap_no_new(rec); heap_no = rec_get_heap_no_new(rec);
ut_a(heap_no >= 2); /* not infimum or supremum */ ut_a(heap_no >= 2); /* not infimum or supremum */
ut_a(heap_no < n_heap); ut_a(heap_no < n_heap);
...@@ -545,12 +545,12 @@ page_zip_dir_encode( ...@@ -545,12 +545,12 @@ page_zip_dir_encode(
ut_a(rec_get_status(rec) == status); ut_a(rec_get_status(rec) == status);
} }
offs = page_header_get_field((page_t*) page, PAGE_FREE); offs = page_header_get_field(page, PAGE_FREE);
/* Traverse the free list (of deleted records). */ /* Traverse the free list (of deleted records). */
while (offs) { while (offs) {
ut_ad(!(offs & ~PAGE_ZIP_DIR_SLOT_MASK)); ut_ad(!(offs & ~PAGE_ZIP_DIR_SLOT_MASK));
rec = (page_t*) page + offs; rec = page + offs;
heap_no = rec_get_heap_no_new(rec); heap_no = rec_get_heap_no_new(rec);
ut_a(heap_no >= 2); /* not infimum or supremum */ ut_a(heap_no >= 2); /* not infimum or supremum */
...@@ -649,7 +649,7 @@ page_zip_compress_node_ptrs( ...@@ -649,7 +649,7 @@ page_zip_compress_node_ptrs(
ulint* offsets = NULL; ulint* offsets = NULL;
do { do {
rec_t* rec = (rec_t*) *recs++; const rec_t* rec = *recs++;
offsets = rec_get_offsets(rec, index, offsets, offsets = rec_get_offsets(rec, index, offsets,
ULINT_UNDEFINED, &heap); ULINT_UNDEFINED, &heap);
...@@ -669,7 +669,7 @@ page_zip_compress_node_ptrs( ...@@ -669,7 +669,7 @@ page_zip_compress_node_ptrs(
ut_ad(!c_stream->avail_in); ut_ad(!c_stream->avail_in);
/* Compress the data bytes, except node_ptr. */ /* Compress the data bytes, except node_ptr. */
c_stream->next_in = rec; c_stream->next_in = (byte*) rec;
c_stream->avail_in = rec_offs_data_size(offsets) c_stream->avail_in = rec_offs_data_size(offsets)
- REC_NODE_PTR_SIZE; - REC_NODE_PTR_SIZE;
ut_ad(c_stream->avail_in); ut_ad(c_stream->avail_in);
...@@ -761,7 +761,7 @@ page_zip_compress_clust( ...@@ -761,7 +761,7 @@ page_zip_compress_clust(
do { do {
ulint i; ulint i;
rec_t* rec = (rec_t*) *recs++; const rec_t* rec = *recs++;
offsets = rec_get_offsets(rec, index, offsets, offsets = rec_get_offsets(rec, index, offsets,
ULINT_UNDEFINED, &heap); ULINT_UNDEFINED, &heap);
...@@ -783,7 +783,7 @@ page_zip_compress_clust( ...@@ -783,7 +783,7 @@ page_zip_compress_clust(
/* Compress the data bytes. */ /* Compress the data bytes. */
c_stream->next_in = rec; c_stream->next_in = (byte*) rec;
/* Check if there are any externally stored columns. /* Check if there are any externally stored columns.
For each externally stored column, store the For each externally stored column, store the
...@@ -791,7 +791,7 @@ page_zip_compress_clust( ...@@ -791,7 +791,7 @@ page_zip_compress_clust(
for (i = 0; i < n_fields; i++) { for (i = 0; i < n_fields; i++) {
ulint len; ulint len;
byte* src; const byte* src;
if (UNIV_UNLIKELY(i == trx_id_col)) { if (UNIV_UNLIKELY(i == trx_id_col)) {
ut_ad(!rec_offs_nth_extern(offsets, i)); ut_ad(!rec_offs_nth_extern(offsets, i));
...@@ -888,7 +888,7 @@ page_zip_compress_clust( ...@@ -888,7 +888,7 @@ page_zip_compress_clust(
} }
/* Compress the last bytes of the record. */ /* Compress the last bytes of the record. */
c_stream->avail_in = rec_get_end(rec, offsets) c_stream->avail_in = rec + rec_offs_data_size(offsets)
- c_stream->next_in; - c_stream->next_in;
if (c_stream->avail_in) { if (c_stream->avail_in) {
...@@ -935,8 +935,8 @@ page_zip_compress( ...@@ -935,8 +935,8 @@ page_zip_compress(
ulint n_blobs = 0; ulint n_blobs = 0;
byte* storage;/* storage of uncompressed columns */ byte* storage;/* storage of uncompressed columns */
ut_a(page_is_comp((page_t*) page)); ut_a(page_is_comp(page));
ut_a(fil_page_get_type((page_t*) page) == FIL_PAGE_INDEX); ut_a(fil_page_get_type(page) == FIL_PAGE_INDEX);
ut_ad(page_simple_validate_new((page_t*) page)); ut_ad(page_simple_validate_new((page_t*) page));
ut_ad(page_zip_simple_validate(page_zip)); ut_ad(page_zip_simple_validate(page_zip));
...@@ -951,8 +951,8 @@ page_zip_compress( ...@@ -951,8 +951,8 @@ page_zip_compress(
ut_a(!memcmp(page + (PAGE_NEW_SUPREMUM - REC_N_NEW_EXTRA_BYTES + 1), ut_a(!memcmp(page + (PAGE_NEW_SUPREMUM - REC_N_NEW_EXTRA_BYTES + 1),
supremum_extra_data, sizeof supremum_extra_data)); supremum_extra_data, sizeof supremum_extra_data));
if (UNIV_UNLIKELY(!page_get_n_recs((page_t*) page))) { if (UNIV_UNLIKELY(!page_get_n_recs(page))) {
ut_a(rec_get_next_offs((page_t*) page + PAGE_NEW_INFIMUM, TRUE) ut_a(rec_get_next_offs(page + PAGE_NEW_INFIMUM, TRUE)
== PAGE_NEW_SUPREMUM); == PAGE_NEW_SUPREMUM);
} }
...@@ -963,7 +963,7 @@ page_zip_compress( ...@@ -963,7 +963,7 @@ page_zip_compress(
} }
/* The dense directory excludes the infimum and supremum records. */ /* The dense directory excludes the infimum and supremum records. */
n_dense = page_dir_get_n_heap((page_t*) page) - 2; n_dense = page_dir_get_n_heap(page) - 2;
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
if (UNIV_UNLIKELY(page_zip_compress_dbg)) { if (UNIV_UNLIKELY(page_zip_compress_dbg)) {
fprintf(stderr, "compress %p %p %lu %lu %lu\n", fprintf(stderr, "compress %p %p %lu %lu %lu\n",
...@@ -1070,7 +1070,7 @@ page_zip_compress( ...@@ -1070,7 +1070,7 @@ page_zip_compress(
err = page_zip_compress_clust(&c_stream, recs, n_dense, err = page_zip_compress_clust(&c_stream, recs, n_dense,
index, &n_blobs, trx_id_col, index, &n_blobs, trx_id_col,
buf_end - PAGE_ZIP_DIR_SLOT_SIZE buf_end - PAGE_ZIP_DIR_SLOT_SIZE
* page_get_n_recs((page_t*)page), * page_get_n_recs(page),
storage, heap); storage, heap);
if (UNIV_UNLIKELY(err != Z_OK)) { if (UNIV_UNLIKELY(err != Z_OK)) {
goto zlib_error; goto zlib_error;
...@@ -1083,7 +1083,7 @@ page_zip_compress( ...@@ -1083,7 +1083,7 @@ page_zip_compress(
allocated from an originally longer space on the free list, allocated from an originally longer space on the free list,
or the data of the last record from page_zip_compress_sec(). */ or the data of the last record from page_zip_compress_sec(). */
c_stream.avail_in c_stream.avail_in
= page_header_get_field((page_t*) page, PAGE_HEAP_TOP) = page_header_get_field(page, PAGE_HEAP_TOP)
- (c_stream.next_in - page); - (c_stream.next_in - page);
ut_a(c_stream.avail_in <= UNIV_PAGE_SIZE - PAGE_ZIP_START - PAGE_DIR); ut_a(c_stream.avail_in <= UNIV_PAGE_SIZE - PAGE_ZIP_START - PAGE_DIR);
...@@ -2386,7 +2386,7 @@ page_zip_validate( ...@@ -2386,7 +2386,7 @@ page_zip_validate(
ibool valid; ibool valid;
ut_a(buf_frame_get_page_zip((byte*) page) == page_zip); ut_a(buf_frame_get_page_zip((byte*) page) == page_zip);
ut_a(page_is_comp((page_t*) page)); ut_a(page_is_comp(page));
if (memcmp(page_zip->data + FIL_PAGE_PREV, page + FIL_PAGE_PREV, if (memcmp(page_zip->data + FIL_PAGE_PREV, page + FIL_PAGE_PREV,
FIL_PAGE_LSN - FIL_PAGE_PREV) FIL_PAGE_LSN - FIL_PAGE_PREV)
...@@ -2484,7 +2484,7 @@ page_zip_write_rec( ...@@ -2484,7 +2484,7 @@ page_zip_write_rec(
ut_ad(page_zip_simple_validate(page_zip)); ut_ad(page_zip_simple_validate(page_zip));
ut_ad(page_zip->size > PAGE_DATA + page_zip_dir_size(page_zip)); ut_ad(page_zip->size > PAGE_DATA + page_zip_dir_size(page_zip));
ut_ad(rec_offs_comp(offsets)); ut_ad(rec_offs_comp(offsets));
ut_ad(rec_offs_validate((rec_t*) rec, index, offsets)); ut_ad(rec_offs_validate(rec, index, offsets));
ut_ad(page_zip->m_start >= PAGE_DATA); ut_ad(page_zip->m_start >= PAGE_DATA);
...@@ -2665,7 +2665,7 @@ page_zip_write_rec( ...@@ -2665,7 +2665,7 @@ page_zip_write_rec(
} }
/* Log the last bytes of the record. */ /* Log the last bytes of the record. */
len = rec_get_end((rec_t*) rec, offsets) - start; len = rec + rec_offs_data_size(offsets) - start;
ut_ad(!memcmp(data, zero, ut_min(len, sizeof zero))); ut_ad(!memcmp(data, zero, ut_min(len, sizeof zero)));
memcpy(data, start, len); memcpy(data, start, len);
...@@ -3580,7 +3580,7 @@ page_zip_copy( ...@@ -3580,7 +3580,7 @@ page_zip_copy(
#endif /* UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
ut_a(page_zip->size == src_zip->size); ut_a(page_zip->size == src_zip->size);
if (UNIV_UNLIKELY(src_zip->n_blobs)) { if (UNIV_UNLIKELY(src_zip->n_blobs)) {
ut_a(page_is_leaf((page_t*) src)); ut_a(page_is_leaf(src));
ut_a(dict_index_is_clust(index)); ut_a(dict_index_is_clust(index));
} }
......
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