From: Date: October 3 2007 9:54am Subject: bk commit into 5.1 tree (mskold:1.2562) BUG#25817 List-Archive: http://lists.mysql.com/commits/34808 X-Bug: 25817 Message-Id: <20071003075449.F247A33EB01@linux.site> Below is the list of changes that have just been committed into a local 5.1 repository of marty. When marty 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-03 09:54:33+02:00, mskold@stripped +1 -0 Bug#25817 UPDATE IGNORE doesn't check write_set when checking unique indexes: Post merge 5.0->5.1 sql/ha_ndbcluster.cc@stripped, 2007-10-03 09:53:49+02:00, mskold@stripped +8 -7 Bug#25817 UPDATE IGNORE doesn't check write_set when checking unique indexes: Post merge 5.0->5.1 diff -Nrup a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc --- a/sql/ha_ndbcluster.cc 2007-10-02 14:23:52 +02:00 +++ b/sql/ha_ndbcluster.cc 2007-10-03 09:53:49 +02:00 @@ -1651,14 +1651,10 @@ bool ha_ndbcluster::check_index_fields_i uint i; DBUG_ENTER("check_index_fields_in_write_set"); - if (m_retrieve_all_fields) - { - DBUG_RETURN(true); - } for (i= 0; key_part != end; key_part++, i++) { Field* field= key_part->field; - if (field->query_id != current_thd->query_id) + if (!bitmap_is_set(table->write_set, field->field_index)) { DBUG_RETURN(false); } @@ -1985,7 +1981,7 @@ check_null_in_record(const KEY* key_info * primary key or unique index values */ -int ha_ndbcluster::peek_indexed_rows(const byte *record, +int ha_ndbcluster::peek_indexed_rows(const uchar *record, NDB_WRITE_OP write_op) { NdbTransaction *trans= m_active_trans; @@ -1998,7 +1994,7 @@ int ha_ndbcluster::peek_indexed_rows(con NdbOperation::LockMode lm= (NdbOperation::LockMode)get_ndb_lock_type(m_lock.type); first= NULL; - if (check_pk && table->s->primary_key != MAX_KEY) + if (write_op != NDB_UPDATE && table->s->primary_key != MAX_KEY) { /* * Fetch any row with colliding primary key @@ -2048,6 +2044,11 @@ int ha_ndbcluster::peek_indexed_rows(con DBUG_PRINT("info", ("skipping check for key with NULL")); continue; } + if (write_op != NDB_INSERT && !check_index_fields_in_write_set(i)) + { + DBUG_PRINT("info", ("skipping check for key %u not in write_set", i)); + continue; + } NdbIndexOperation *iop; const NDBINDEX *unique_index = m_index[i].unique_index; key_part= key_info->key_part;