From: Date: October 25 2007 12:09pm Subject: bk commit into 5.1 tree (tomas:1.2673) BUG#31841 List-Archive: http://lists.mysql.com/commits/36332 X-Bug: 31841 Message-Id: <20071025100946.EA178180EA10D@linux.local> Below is the list of changes that have just been committed into a local 5.1 repository of tomas. When tomas does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-10-25 12:09:40+02:00, tomas@stripped +2 -0 Bug #31841 write_set should not be set for pk during update_row - also add small optim not to loop over the pk's if there are none in the write_set sql/ha_ndbcluster.cc@stripped, 2007-10-25 12:09:37+02:00, tomas@stripped +7 -1 Bug #31841 write_set should not be set for pk during update_row - also add small optim not to loop over the pk's if there are none in the write_set sql/log_event.cc@stripped, 2007-10-25 12:09:37+02:00, tomas@stripped +12 -0 Bug #31841 write_set should not be set for pk during update_row - also add small optim not to loop over the pk's if there are none in the write_set diff -Nrup a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc --- a/sql/ha_ndbcluster.cc 2007-10-23 17:04:28 +02:00 +++ b/sql/ha_ndbcluster.cc 2007-10-25 12:09:37 +02:00 @@ -3757,6 +3757,10 @@ int ha_ndbcluster::primary_key_cmp(const return 1; } } + /* + potentially not needed call to this function + */ + DBUG_ASSERT(!table->in_use->slave_thread || (m_ignore_no_key == FALSE)); return 0; } @@ -3965,7 +3969,9 @@ int ha_ndbcluster::update_row(const ucha int error; longlong func_value; bool have_pk= (table_share->primary_key != MAX_KEY); - bool pk_update= (have_pk && primary_key_cmp(old_data, new_data)); + bool pk_update= (have_pk && + bitmap_is_overlapping(table->write_set, &m_pk_bitmap) && + primary_key_cmp(old_data, new_data)); DBUG_ENTER("update_row"); DBUG_ASSERT(trans); /* diff -Nrup a/sql/log_event.cc b/sql/log_event.cc --- a/sql/log_event.cc 2007-10-14 12:34:10 +02:00 +++ b/sql/log_event.cc 2007-10-25 12:09:37 +02:00 @@ -7988,6 +7988,18 @@ Update_rows_log_event::do_before_row_ope { if (m_table->s->keys > 0) { + /* + primary key columns should not be set in write_set + */ + if (m_table->s->primary_key != MAX_KEY) + { + KEY *key= m_table->key_info + m_table->s->primary_key; + KEY_PART_INFO *key_part= key->key_part; + KEY_PART_INFO *end= key_part + key->key_parts; + for (; key_part != end; key_part++) + bitmap_clear_bit(m_table->write_set, key_part->fieldnr - 1); + } + // Allocate buffer for key searches m_key= (uchar*)my_malloc(m_table->key_info->key_length, MYF(MY_WME)); if (!m_key)