Commit 17d08416 authored by Marko Mäkelä's avatar Marko Mäkelä

Disambiguate rec_is_alter_metadata()

parent 26897301
......@@ -4769,7 +4769,7 @@ btr_cur_pessimistic_update(
page_is_comp(page),
dict_index_get_n_fields(index),
block->page.size)
|| UNIV_UNLIKELY(rec_is_alter_metadata(rec, index))) {
|| UNIV_UNLIKELY(rec_is_alter_metadata(rec, *index))) {
big_rec_vec = dtuple_convert_big_rec(index, update, new_entry, &n_ext);
if (UNIV_UNLIKELY(big_rec_vec == NULL)) {
......@@ -4884,7 +4884,7 @@ btr_cur_pessimistic_update(
}
if (!rec_get_deleted_flag(rec, rec_offs_comp(*offsets))
|| rec_is_alter_metadata(rec, index)) {
|| rec_is_alter_metadata(rec, *index)) {
/* The new inserted record owns its possible externally
stored fields */
btr_cur_unmark_extern_fields(
......
......@@ -804,10 +804,10 @@ in the clustered index for instant ALTER TABLE (not plain ADD COLUMN).
@param[in] rec leaf page record
@param[in] index index of the record
@return whether the record is the ALTER TABLE metadata pseudo-record */
inline bool rec_is_alter_metadata(const rec_t* rec, const dict_index_t* index)
inline bool rec_is_alter_metadata(const rec_t* rec, const dict_index_t& index)
{
bool is = rec_is_alter_metadata(rec, dict_table_is_comp(index->table));
ut_ad(!is || index->is_instant());
bool is = rec_is_alter_metadata(rec, dict_table_is_comp(index.table));
ut_ad(!is || index.is_instant());
return is;
}
......
......@@ -492,7 +492,7 @@ rec_offs_make_valid(
ulint* offsets)
{
const bool is_alter_metadata = leaf
&& rec_is_alter_metadata(rec, index);
&& rec_is_alter_metadata(rec, *index);
ut_ad(is_alter_metadata
|| rec_offs_n_fields(offsets)
<= (leaf
......@@ -884,7 +884,7 @@ rec_get_offsets_func(
|| n == n_fields /* btr_pcur_restore_position() */
|| (n + (index->id == DICT_INDEXES_ID)
>= index->n_core_fields && n <= index->n_fields
+ unsigned(rec_is_alter_metadata(rec, ulint(0)))));
+ unsigned(rec_is_alter_metadata(rec, false))));
if (is_user_rec && leaf && n < index->n_fields) {
ut_ad(!index->is_dummy);
......
......@@ -840,7 +840,7 @@ static void row_purge_reset_trx_id(purge_node_t* node, mtr_t* mtr)
== row_get_rec_roll_ptr(rec, index, offsets)) {
ut_ad(!rec_get_deleted_flag(
rec, rec_offs_comp(offsets))
|| rec_is_alter_metadata(rec, index));
|| rec_is_alter_metadata(rec, *index));
DBUG_LOG("purge", "reset DB_TRX_ID="
<< ib::hex(row_get_rec_trx_id(
rec, index, offsets)));
......
......@@ -730,7 +730,7 @@ row_rec_to_index_entry_impl(
ut_ad(mblob != 2
|| rec_offs_n_fields(offsets)
== ulint(index->n_fields + rec_is_alter_metadata(rec, index)));
== ulint(index->n_fields + rec_is_alter_metadata(rec, *index)));
ulint rec_len = mblob == 2
? ulint(index->n_fields
......@@ -779,7 +779,7 @@ row_rec_to_index_entry_impl(
ulint j = i;
if (mblob == 2) {
const bool got = rec_is_alter_metadata(rec, index);
const bool got = rec_is_alter_metadata(rec, *index);
const bool want = info_bits == REC_INFO_METADATA_ALTER;
if (got == want) {
if (got) {
......@@ -880,7 +880,7 @@ row_rec_to_index_entry(
rec_offs_make_valid(copy_rec, index, true,
const_cast<ulint*>(offsets));
dtuple_t* entry = rec_is_alter_metadata(copy_rec, index)
dtuple_t* entry = rec_is_alter_metadata(copy_rec, *index)
? row_rec_to_index_entry_impl<true,1>(
copy_rec, index, offsets, n_ext, heap)
: row_rec_to_index_entry_impl<true>(
......@@ -925,7 +925,7 @@ row_metadata_to_tuple(
const_cast<ulint*>(offsets));
dtuple_t* entry = info_bits == REC_INFO_METADATA_ALTER
|| rec_is_alter_metadata(copy_rec, index)
|| rec_is_alter_metadata(copy_rec, *index)
? row_rec_to_index_entry_impl<true,2>(
copy_rec, index, offsets, n_ext, heap, info_bits)
: row_rec_to_index_entry_impl<true>(
......
......@@ -1050,7 +1050,7 @@ trx_undo_page_report_modify(
ut_ad(update->fields[0].new_val.len == FIELD_REF_SIZE);
/* The instant ADD COLUMN metadata record does not
contain the BLOB. Do not write anything for it. */
i = !rec_is_alter_metadata(rec, index);
i = !rec_is_alter_metadata(rec, *index);
n_updated -= i;
}
......@@ -1119,7 +1119,7 @@ trx_undo_page_report_modify(
ut_ad(pos >= index->first_user_field());
ut_ad(rec_is_metadata(rec, index));
if (rec_is_alter_metadata(rec, index)) {
if (rec_is_alter_metadata(rec, *index)) {
ut_ad(update->is_alter_metadata());
field = rec_offs_n_fields(offsets)
......@@ -1168,7 +1168,8 @@ trx_undo_page_report_modify(
if (rec_offs_nth_extern(offsets, pos)) {
ut_ad(col || pos == index->first_user_field());
ut_ad(col || update->is_alter_metadata());
ut_ad(col || rec_is_alter_metadata(rec,index));
ut_ad(col
|| rec_is_alter_metadata(rec, *index));
ulint prefix_len = col
? dict_max_field_len_store_undo(
table, col)
......
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