diff options
author | Satya Bodapati <satya.bodapati@oracle.com> | 2013-09-11 17:02:18 +0530 |
---|---|---|
committer | Satya Bodapati <satya.bodapati@oracle.com> | 2013-09-11 17:02:18 +0530 |
commit | 9910b732a73541e9c74b33235d2b07b4617a9173 (patch) | |
tree | 2d04560562e1ee58a5a53ace1e7092c6cfc82c20 /storage/innobase/btr | |
parent | 18b3f62e19f8ed03b7c1f52c58e445d57722e520 (diff) | |
parent | f166ec71b78fdf7a08ba413509cf00ad9e003b3c (diff) | |
download | mariadb-git-9910b732a73541e9c74b33235d2b07b4617a9173.tar.gz |
Merge fix for BUG#16752251 from mysql-5.1 to mysql-5.5
Diffstat (limited to 'storage/innobase/btr')
-rw-r--r-- | storage/innobase/btr/btr0cur.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c index 81a482e2854..16d5016a9b5 100644 --- a/storage/innobase/btr/btr0cur.c +++ b/storage/innobase/btr/btr0cur.c @@ -1631,7 +1631,7 @@ btr_cur_upd_lock_and_undo( /***********************************************************//** Writes a redo log record of updating a record in-place. */ -UNIV_INLINE +UNIV_INTERN void btr_cur_update_in_place_log( /*========================*/ @@ -1659,18 +1659,30 @@ btr_cur_update_in_place_log( return; } - /* The code below assumes index is a clustered index: change index to - the clustered index if we are updating a secondary index record (or we - could as well skip writing the sys col values to the log in this case - because they are not needed for a secondary index record update) */ - - index = dict_table_get_first_index(index->table); + /* For secondary indexes, we could skip writing the dummy system fields + to the redo log but we have to change redo log parsing of + MLOG_REC_UPDATE_IN_PLACE/MLOG_COMP_REC_UPDATE_IN_PLACE or we have to add + new redo log record. For now, just write dummy sys fields to the redo + log if we are updating a secondary index record. + */ mach_write_to_1(log_ptr, flags); log_ptr++; - log_ptr = row_upd_write_sys_vals_to_log(index, trx, roll_ptr, log_ptr, - mtr); + if (dict_index_is_clust(index)) { + log_ptr = row_upd_write_sys_vals_to_log( + index, trx, roll_ptr, log_ptr, mtr); + } else { + /* Dummy system fields for a secondary index */ + /* TRX_ID Position */ + log_ptr += mach_write_compressed(log_ptr, 0); + /* ROLL_PTR */ + trx_write_roll_ptr(log_ptr, 0); + log_ptr += DATA_ROLL_PTR_LEN; + /* TRX_ID */ + log_ptr += mach_ull_write_compressed(log_ptr, 0); + } + mach_write_to_2(log_ptr, page_offset(rec)); log_ptr += 2; |