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
This commit is contained in:
unknown 2006-06-14 20:18:01 +02:00
commit 06828ae513
3 changed files with 134 additions and 0 deletions

View file

@ -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 */