3896 Marko Mäkelä 2012-05-29
WL#6255 bug fixes.
prepare_inplace_alter_table_dict(): Pass the same_pk flag correctly to
row_log_allocate().
ha_innobase::inplace_alter_table(): Relax an assertion on
table->n_ref_count. A table that is being rebuilt online can be accessed.
modified:
storage/innobase/handler/handler0alter.cc
3895 Marko Mäkelä 2012-05-29
WL#6255 bug fixes
row_log_table_update(): Correct debug assertions about old_pk.
Fix logging errors.
row_log_table_get_pk(): Initialize the return value.
modified:
storage/innobase/row/row0log.cc
3894 Marko Mäkelä 2012-05-29
WL#6255 bug fix
row_ins_clust_index_entry_low(): Initialize rec for online logging.
modified:
storage/innobase/row/row0ins.cc
=== modified file 'storage/innobase/handler/handler0alter.cc'
--- a/storage/innobase/handler/handler0alter.cc revid:marko.makela@stripped
+++ b/storage/innobase/handler/handler0alter.cc revid:marko.makela@stripped
@@ -1740,8 +1740,8 @@ col_fail:
rw_lock_x_lock(&clust_index->lock);
bool ok = row_log_allocate(
clust_index, indexed_table,
- !!(ha_alter_info->handler_flags
- & Alter_inplace_info::ADD_PK_INDEX));
+ !(ha_alter_info->handler_flags
+ & Alter_inplace_info::ADD_PK_INDEX));
rw_lock_x_unlock(&clust_index->lock);
if (!ok) {
@@ -2561,7 +2561,8 @@ oom:
/* n_ref_count must be 1, or 2 when purge
happens to be executing on this very table. */
- DBUG_ASSERT(ctx->indexed_table == prebuilt->table
+ DBUG_ASSERT(ctx->online
+ || ctx->indexed_table == prebuilt->table
|| prebuilt->table->n_ref_count - 1 <= 1);
prebuilt->trx->error_info = NULL;
ctx->trx->error_state = DB_SUCCESS;
=== modified file 'storage/innobase/row/row0log.cc'
--- a/storage/innobase/row/row0log.cc revid:marko.makela@stripped1uctynzb
+++ b/storage/innobase/row/row0log.cc revid:marko.makela@stripped
@@ -525,7 +525,10 @@ row_log_table_update(
ut_ad(rw_lock_own(&index->lock, RW_LOCK_SHARED)
|| rw_lock_own(&index->lock, RW_LOCK_EX));
#endif /* UNIV_SYNC_DEBUG */
+ ut_ad(!old_pk || old_pk->n_fields == 2 + old_pk->n_fields_cmp);
ut_ad(!old_pk || DATA_TRX_ID_LEN == dtuple_get_nth_field(
+ old_pk, old_pk->n_fields - 2)->len);
+ ut_ad(!old_pk || DATA_ROLL_PTR_LEN == dtuple_get_nth_field(
old_pk, old_pk->n_fields - 1)->len);
if (dict_index_is_corrupted(index)
@@ -545,7 +548,7 @@ row_log_table_update(
extra_size = rec_offs_extra_size(offsets) - omit_size;
mrec_size = rec_offs_size(offsets) - omit_size
- + (ROW_LOG_HEADER_SIZE + 1) + (extra_size >= 0x80);
+ + ROW_LOG_HEADER_SIZE + (extra_size >= 0x80);
if (index->online_log->same_pk) {
ut_ad(!old_pk);
@@ -566,7 +569,7 @@ row_log_table_update(
mrec_size, &avail_size)) {
*b++ = ROW_T_UPDATE;
- if (old_pk_extra_size) {
+ if (old_pk_size) {
*b++ = old_pk_extra_size;
rec_convert_dtuple_to_rec_comp(
@@ -611,6 +614,8 @@ row_log_table_get_pk(
const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */
mem_heap_t** heap) /*!< in/out: memory heap where allocated */
{
+ dtuple_t* tuple = NULL;
+
ut_ad(dict_index_is_clust(index));
ut_ad(dict_index_is_online_ddl(index));
ut_ad(!offsets || rec_offs_validate(rec, index, offsets));
@@ -627,8 +632,6 @@ row_log_table_get_pk(
return(NULL);
}
- dtuple_t* tuple;
-
mutex_enter(&index->online_log->mutex);
/* index->online_log->error is protected by the above mutex. */
No bundle (reason: useless for push emails).| Thread |
|---|
| • bzr push into mysql-trunk-wl6255 branch (marko.makela:3894 to 3896) WL#6255 | marko.makela | 29 May |