diff options
author | tomas@poseidon.ndb.mysql.com <> | 2006-06-14 22:12:18 +0200 |
---|---|---|
committer | tomas@poseidon.ndb.mysql.com <> | 2006-06-14 22:12:18 +0200 |
commit | 2746b739687175a3a362e5872b0c59c2bace0804 (patch) | |
tree | 31ddd6419e150bcd176a57476b1b27763349506f /sql | |
parent | 9b79108e961515aa1271e4ceb2a0cfb78d892c48 (diff) | |
parent | 49b9b9a01772888a7c1342477dab2fe3d8560e35 (diff) | |
download | mariadb-git-2746b739687175a3a362e5872b0c59c2bace0804.tar.gz |
Merge poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_ndbcluster.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 0bda9acaed5..f2e701807fe 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2452,6 +2452,11 @@ int ha_ndbcluster::write_row(byte *record) */ if (!m_use_write && m_ignore_dup_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_indexed_rows(record); if (!peek_res) @@ -3693,6 +3698,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_indexed_rows() 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 */ |