summaryrefslogtreecommitdiff
path: root/storage/innodb_plugin/row
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innodb_plugin/row')
-rw-r--r--storage/innodb_plugin/row/row0merge.c9
-rw-r--r--storage/innodb_plugin/row/row0mysql.c9
-rw-r--r--storage/innodb_plugin/row/row0row.c61
-rw-r--r--storage/innodb_plugin/row/row0sel.c3
4 files changed, 17 insertions, 65 deletions
diff --git a/storage/innodb_plugin/row/row0merge.c b/storage/innodb_plugin/row/row0merge.c
index 2feeba91bf5..05a45dc647c 100644
--- a/storage/innodb_plugin/row/row0merge.c
+++ b/storage/innodb_plugin/row/row0merge.c
@@ -849,7 +849,14 @@ err_exit:
avail_size = block[1] - b;
memcpy(*buf, b, avail_size);
*mrec = *buf + extra_size;
- rec_offs_make_valid(*mrec, index, offsets);
+#ifdef UNIV_DEBUG
+ /* We cannot invoke rec_offs_make_valid() here, because there
+ are no REC_N_NEW_EXTRA_BYTES between extra_size and data_size.
+ Similarly, rec_offs_validate() would fail, because it invokes
+ rec_get_status(). */
+ offsets[2] = (ulint) *mrec;
+ offsets[3] = (ulint) index;
+#endif /* UNIV_DEBUG */
if (!row_merge_read(fd, ++(*foffs), block)) {
diff --git a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c
index b915de20c33..b345bb59624 100644
--- a/storage/innodb_plugin/row/row0mysql.c
+++ b/storage/innodb_plugin/row/row0mysql.c
@@ -1498,9 +1498,14 @@ row_unlock_for_mysql(
index = btr_pcur_get_btr_cur(clust_pcur)->index;
}
+ if (UNIV_UNLIKELY(!dict_index_is_clust(index))) {
+ /* This is not a clustered index record. We
+ do not know how to unlock the record. */
+ goto no_unlock;
+ }
+
/* If the record has been modified by this
transaction, do not unlock it. */
- ut_a(dict_index_is_clust(index));
if (index->trx_id_offset) {
rec_trx_id = trx_read_trx_id(rec
@@ -1540,7 +1545,7 @@ row_unlock_for_mysql(
prebuilt->select_lock_type);
}
}
-
+no_unlock:
mtr_commit(&mtr);
}
diff --git a/storage/innodb_plugin/row/row0row.c b/storage/innodb_plugin/row/row0row.c
index c453252b3b3..128ac3ba3e8 100644
--- a/storage/innodb_plugin/row/row0row.c
+++ b/storage/innodb_plugin/row/row0row.c
@@ -643,67 +643,6 @@ notfound:
}
}
-/*******************************************************************//**
-From a row build a row reference with which we can search the clustered
-index record. */
-UNIV_INTERN
-void
-row_build_row_ref_from_row(
-/*=======================*/
- dtuple_t* ref, /*!< in/out: row reference built;
- see the NOTE below!
- ref must have the right number
- of fields! */
- const dict_table_t* table, /*!< in: table */
- const dtuple_t* row) /*!< in: row
- NOTE: the data fields in ref will point
- directly into data of this row */
-{
- const dict_index_t* clust_index;
- ulint ref_len;
- ulint i;
-
- ut_ad(ref && table && row);
-
- clust_index = dict_table_get_first_index(table);
-
- ref_len = dict_index_get_n_unique(clust_index);
-
- ut_ad(ref_len == dtuple_get_n_fields(ref));
-
- for (i = 0; i < ref_len; i++) {
- const dict_col_t* col;
- const dict_field_t* field;
- dfield_t* dfield;
- const dfield_t* dfield2;
-
- dfield = dtuple_get_nth_field(ref, i);
-
- field = dict_index_get_nth_field(clust_index, i);
-
- col = dict_field_get_col(field);
-
- dfield2 = dtuple_get_nth_field(row, dict_col_get_no(col));
-
- dfield_copy(dfield, dfield2);
- ut_ad(!dfield_is_ext(dfield));
-
- if (field->prefix_len > 0 && !dfield_is_null(dfield)) {
-
- ulint len = dfield_get_len(dfield);
-
- len = dtype_get_at_most_n_mbchars(
- col->prtype, col->mbminlen, col->mbmaxlen,
- field->prefix_len,
- len, dfield_get_data(dfield));
-
- dfield_set_len(dfield, len);
- }
- }
-
- ut_ad(dtuple_check_typed(ref));
-}
-
/***************************************************************//**
Searches the clustered index record for a row, if we have the row reference.
@return TRUE if found */
diff --git a/storage/innodb_plugin/row/row0sel.c b/storage/innodb_plugin/row/row0sel.c
index ea6945813ed..3ef9726588e 100644
--- a/storage/innodb_plugin/row/row0sel.c
+++ b/storage/innodb_plugin/row/row0sel.c
@@ -2782,7 +2782,8 @@ row_sel_store_mysql_rec(
mysql_rec[templ->mysql_null_byte_offset]
|= (byte) templ->mysql_null_bit_mask;
memcpy(mysql_rec + templ->mysql_col_offset,
- prebuilt->default_rec + templ->mysql_col_offset,
+ (const byte*) prebuilt->default_rec
+ + templ->mysql_col_offset,
templ->mysql_col_len);
}
}