3889 Marko Mäkelä 2012-05-29
WL#6255 refactoring.
row_upd_build_difference_binary(): Add the parameters offsets and no_sys.
When applying logged rows in online table rebuild, we do need to include
DB_TRX_ID and DB_ROLL_PTR in the update vector.
modified:
storage/innobase/include/row0upd.h
storage/innobase/row/row0ins.cc
storage/innobase/row/row0upd.cc
3888 Marko Mäkelä 2012-05-29
WL#6255 debug assertion relaxation
rec_init_offsets_comp_ordinary():
Allow n_null < index->n_nullable. Assert that of the processed fields,
no more than n_null are NULLable.
modified:
storage/innobase/rem/rem0rec.cc
=== modified file 'storage/innobase/include/row0upd.h'
--- a/storage/innobase/include/row0upd.h revid:marko.makela@strippedqt5
+++ b/storage/innobase/include/row0upd.h revid:marko.makela@stripped
@@ -205,14 +205,19 @@ the equal ordering fields. NOTE: we comp
@return own: update vector of differing fields, excluding roll ptr and
trx id */
UNIV_INTERN
-upd_t*
+const upd_t*
row_upd_build_difference_binary(
/*============================*/
dict_index_t* index, /*!< in: clustered index */
const dtuple_t* entry, /*!< in: entry to insert */
const rec_t* rec, /*!< in: clustered index record */
- trx_t* trx, /*!< in: transaction */
- mem_heap_t* heap); /*!< in: memory heap from which allocated */
+ const ulint* offsets,/*!< in: rec_get_offsets(rec,index), or NULL */
+ bool no_sys, /*!< in: skip the system columns
+ DB_TRX_ID and DB_ROLL_PTR */
+ trx_t* trx, /*!< in: transaction (for diagnostics),
+ or NULL */
+ mem_heap_t* heap) /*!< in: memory heap from which allocated */
+ __attribute__((nonnull(1,2,3,7), warn_unused_result));
/***********************************************************//**
Replaces the new column values stored in the update vector to the index entry
given. */
=== modified file 'storage/innobase/row/row0ins.cc'
--- a/storage/innobase/row/row0ins.cc revid:marko.makela@stripped0008-bji70kqyswnm5qt5
+++ b/storage/innobase/row/row0ins.cc revid:marko.makela@stripped5oq9aev
@@ -325,8 +325,8 @@ row_ins_clust_index_entry_by_modify(
mtr_t* mtr) /*!< in: mtr; must be committed before
latching any further pages */
{
- rec_t* rec;
- upd_t* update;
+ const rec_t* rec;
+ const upd_t* update;
dberr_t err;
ut_ad(dict_index_is_clust(cursor->index));
@@ -342,8 +342,9 @@ row_ins_clust_index_entry_by_modify(
NOTE that this vector may NOT contain system columns trx_id or
roll_ptr */
- update = row_upd_build_difference_binary(cursor->index, entry, rec,
- thr_get_trx(thr), heap);
+ update = row_upd_build_difference_binary(
+ cursor->index, entry, rec, NULL, true,
+ thr_get_trx(thr), heap);
if (mode == BTR_MODIFY_LEAF) {
/* Try optimistic updating of the record, keeping changes
within the page */
=== modified file 'storage/innobase/row/row0upd.cc'
--- a/storage/innobase/row/row0upd.cc revid:marko.makela@strippedwnm5qt5
+++ b/storage/innobase/row/row0upd.cc revid:marko.makela@stripped
@@ -848,12 +848,15 @@ the equal ordering fields. NOTE: we comp
@return own: update vector of differing fields, excluding roll ptr and
trx id */
UNIV_INTERN
-upd_t*
+const upd_t*
row_upd_build_difference_binary(
/*============================*/
dict_index_t* index, /*!< in: clustered index */
const dtuple_t* entry, /*!< in: entry to insert */
const rec_t* rec, /*!< in: clustered index record */
+ const ulint* offsets,/*!< in: rec_get_offsets(rec,index), or NULL */
+ bool no_sys, /*!< in: skip the system columns
+ DB_TRX_ID and DB_ROLL_PTR */
trx_t* trx, /*!< in: transaction */
mem_heap_t* heap) /*!< in: memory heap from which allocated */
{
@@ -863,11 +866,9 @@ row_upd_build_difference_binary(
ulint len;
upd_t* update;
ulint n_diff;
- ulint roll_ptr_pos;
ulint trx_id_pos;
ulint i;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
- const ulint* offsets;
rec_offs_init(offsets_);
/* This function is used only for a clustered index */
@@ -877,11 +878,16 @@ row_upd_build_difference_binary(
n_diff = 0;
- roll_ptr_pos = dict_index_get_sys_col_pos(index, DATA_ROLL_PTR);
trx_id_pos = dict_index_get_sys_col_pos(index, DATA_TRX_ID);
+ ut_ad(dict_index_get_sys_col_pos(index, DATA_ROLL_PTR)
+ == trx_id_pos + 1);
- offsets = rec_get_offsets(rec, index, offsets_,
- ULINT_UNDEFINED, &heap);
+ if (!offsets) {
+ offsets = rec_get_offsets(rec, index, offsets_,
+ ULINT_UNDEFINED, &heap);
+ } else {
+ ut_ad(rec_offs_validate(rec, index, offsets));
+ }
for (i = 0; i < dtuple_get_n_fields(entry); i++) {
@@ -892,9 +898,9 @@ row_upd_build_difference_binary(
/* NOTE: we compare the fields as binary strings!
(No collation) */
- if (i == trx_id_pos || i == roll_ptr_pos) {
+ if (no_sys && (i == trx_id_pos || i == trx_id_pos + 1)) {
- goto skip_compare;
+ continue;
}
if (!dfield_is_ext(dfield)
@@ -909,8 +915,6 @@ row_upd_build_difference_binary(
n_diff++;
}
-skip_compare:
- ;
}
update->n_fields = n_diff;
No bundle (reason: useless for push emails).| Thread |
|---|
| • bzr push into mysql-trunk-wl6255 branch (marko.makela:3888 to 3889) WL#6255 | marko.makela | 29 May |