summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authormskold/marty@linux.site <>2006-11-30 15:05:09 +0100
committermskold/marty@linux.site <>2006-11-30 15:05:09 +0100
commit2a4de6fc846b57453c8f509ccf4fd27d08defaa0 (patch)
treeca900b0cf07dadecea614d4b7fb2caacf03a2dcf /sql/ha_ndbcluster.cc
parent6db1610c21a4e5b61d53519b2c8b3398b8044264 (diff)
parentaf324d9cf09e69b5aaf6822fab41f803e691ceb7 (diff)
downloadmariadb-git-2a4de6fc846b57453c8f509ccf4fd27d08defaa0.tar.gz
Merge mysql.com:/windows/Linux_space/MySQL/mysql-5.0
into mysql.com:/windows/Linux_space/MySQL/mysql-5.1
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 0703e18b5f7..2bb1a327b36 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -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)
{