Commit a6a0aa42 authored by unknown's avatar unknown
Browse files

Merge mysql.com:/windows/Linux_space/MySQL/mysql-5.0

into  mysql.com:/windows/Linux_space/MySQL/mysql-5.1


sql/ha_ndbcluster.cc:
  Auto merged
mysql-test/r/ndb_update.result:
  Using local, will regenerate
parents 10e81056 eb36371a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ UPDATE IGNORE t1 set pk1 = 4 where pk1 = 2;
select * from t1 order by pk1;
-- error 1062
UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4;
UPDATE IGNORE t1 set pk1 = 1, c = 2 where pk1 = 4;
select * from t1 order by pk1;
UPDATE t1 set pk1 = pk1 + 10;
select * from t1 order by pk1;
+15 −0
Original line number Diff line number Diff line
@@ -2758,6 +2758,21 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
  DBUG_ENTER("update_row");
  m_write_op= TRUE;
  
  /*
   * If IGNORE the ignore constraint violations on primary and unique keys
   */
  if (m_ignore_dup_key)
  {
    int peek_res= peek_indexed_rows(new_data);
    
    if (!peek_res) 
    {
      DBUG_RETURN(HA_ERR_FOUND_DUPP_KEY);
    }
    if (peek_res != HA_ERR_KEY_NOT_FOUND)
      DBUG_RETURN(peek_res);
  }

  statistic_increment(thd->status_var.ha_update_count, &LOCK_status);
  if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
  {