summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2006-06-14 20:18:01 +0200
committerunknown <tomas@poseidon.ndb.mysql.com>2006-06-14 20:18:01 +0200
commit06828ae5132675835a8aa6a770d8380e3b651ce3 (patch)
treecf415d83fbb5ad17e69a80e4a38d91efa36ad7bd /sql/ha_ndbcluster.cc
parent7189f0a59995035ac4ccdb9ca9033ac03877a029 (diff)
parentca1fd91f160a812f5da149cfb9a8065cf78bf8ad (diff)
downloadmariadb-git-06828ae5132675835a8aa6a770d8380e3b651ce3.tar.gz
Merge poseidon.ndb.mysql.com:/home/tomas/mysql-4.1
into poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-main sql/ha_ndbcluster.cc: Auto merged
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index f09b4bf42f7..2618656193a 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -1880,6 +1880,11 @@ int ha_ndbcluster::write_row(byte *record)
if(m_ignore_dup_key && table->primary_key != MAX_KEY)
{
+ /*
+ compare if expression with that in start_bulk_insert()
+ start_bulk_insert will set parameters to ensure that each
+ write_row is committed individually
+ */
int peek_res= peek_row(record);
if (!peek_res)
@@ -3048,6 +3053,19 @@ void ha_ndbcluster::start_bulk_insert(ha_rows rows)
DBUG_PRINT("enter", ("rows: %d", (int)rows));
m_rows_inserted= (ha_rows) 0;
+ if (!m_use_write && m_ignore_dup_key)
+ {
+ /*
+ compare if expression with that in write_row
+ we have a situation where peek_row() will be called
+ so we cannot batch
+ */
+ DBUG_PRINT("info", ("Batching turned off as duplicate key is "
+ "ignored by using peek_row"));
+ m_rows_to_insert= 1;
+ m_bulk_insert_rows= 1;
+ DBUG_VOID_RETURN;
+ }
if (rows == (ha_rows) 0)
{
/* We don't know how many will be inserted, guess */