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, 2006-11-30 23:10:11+01:00, mskold@stripped +2 -0
bug#18487 UPDATE IGNORE not supported for unique constraint violation of non-primary
key: only check pk if it is updated
sql/ha_ndbcluster.cc@stripped, 2006-11-30 23:09:49+01:00, mskold@stripped +9 -8
bug#18487 UPDATE IGNORE not supported for unique constraint violation of non-primary
key: only check pk if it is updated
sql/ha_ndbcluster.h@stripped, 2006-11-30 23:09:49+01:00, mskold@stripped +1 -1
bug#18487 UPDATE IGNORE not supported for unique constraint violation of non-primary
key: only check pk if it is updated
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: mskold
# Host: linux.site
# Root: /windows/Linux_space/MySQL/mysql-5.1-new-ndb
--- 1.368/sql/ha_ndbcluster.cc 2006-11-30 23:10:27 +01:00
+++ 1.369/sql/ha_ndbcluster.cc 2006-11-30 23:10:27 +01:00
@@ -1885,7 +1885,8 @@ bool ha_ndbcluster::check_all_operations
* primary key or unique index values
*/
-int ha_ndbcluster::peek_indexed_rows(const byte *record)
+int ha_ndbcluster::peek_indexed_rows(const byte *record,
+ bool check_pk)
{
NdbTransaction *trans= m_active_trans;
NdbOperation *op;
@@ -1897,7 +1898,7 @@ int ha_ndbcluster::peek_indexed_rows(con
NdbOperation::LockMode lm=
(NdbOperation::LockMode)get_ndb_lock_type(m_lock.type);
first= NULL;
- if (table->s->primary_key != MAX_KEY)
+ if (check_pk && table->s->primary_key != MAX_KEY)
{
/*
* Fetch any row with colliding primary key
@@ -2622,7 +2623,7 @@ int ha_ndbcluster::write_row(byte *recor
start_bulk_insert will set parameters to ensure that each
write_row is committed individually
*/
- int peek_res= peek_indexed_rows(record);
+ int peek_res= peek_indexed_rows(record, true);
if (!peek_res)
{
@@ -2831,6 +2832,8 @@ int ha_ndbcluster::update_row(const byte
uint32 old_part_id= 0, new_part_id= 0;
int error;
longlong func_value;
+ bool pk_update= (table_share->primary_key != MAX_KEY &&
+ key_cmp(table_share->primary_key, old_data, new_data));
DBUG_ENTER("update_row");
m_write_op= TRUE;
@@ -2838,9 +2841,9 @@ int ha_ndbcluster::update_row(const byte
* If IGNORE the ignore constraint violations on primary and unique keys,
* but check that it is not part of INSERT ... ON DUPLICATE KEY UPDATE
*/
- if (m_ignore_dup_key && thd->lex->sql_command != SQLCOM_INSERT)
+ if (m_ignore_dup_key && thd->lex->sql_command == SQLCOM_UPDATE)
{
- int peek_res= peek_indexed_rows(new_data);
+ int peek_res= peek_indexed_rows(new_data, pk_update);
if (!peek_res)
{
@@ -2870,9 +2873,7 @@ int ha_ndbcluster::update_row(const byte
* Check for update of primary key or partition change
* for special handling
*/
- if (((table_share->primary_key != MAX_KEY) &&
- key_cmp(table_share->primary_key, old_data, new_data)) ||
- (old_part_id != new_part_id))
+ if (pk_update || old_part_id != new_part_id)
{
int read_res, insert_res, delete_res, undo_res;
--- 1.158/sql/ha_ndbcluster.h 2006-11-30 23:10:27 +01:00
+++ 1.159/sql/ha_ndbcluster.h 2006-11-30 23:10:27 +01:00
@@ -846,7 +846,7 @@ private:
const NdbOperation *first,
const NdbOperation *last,
uint errcode);
- int peek_indexed_rows(const byte *record);
+ int peek_indexed_rows(const byte *record, bool check_pk);
int fetch_next(NdbScanOperation* op);
int next_result(byte *buf);
int define_read_attrs(byte* buf, NdbOperation* op);
| Thread |
|---|
| • bk commit into 5.1 tree (mskold:1.2336) BUG#18487 | Martin Skold | 30 Nov |