diff options
author | unknown <msvensson@neptunus.(none)> | 2005-04-07 21:29:33 +0200 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2005-04-07 21:29:33 +0200 |
commit | e997201180a30f5f5652c2ad2ec51992986248f6 (patch) | |
tree | 00401d761f7bd6dd7b629bb43ce5ed8cdb9b2c6c /sql | |
parent | 5fa93a136d8697f054c9614ea50687f613d0d32a (diff) | |
parent | 6a2a0ae5a780e163eae82a9277405e08802754eb (diff) | |
download | mariadb-git-e997201180a30f5f5652c2ad2ec51992986248f6.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
sql/ha_ndbcluster.cc:
Auto merged
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_ndbcluster.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index b22e09725ee..495060eb994 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2989,7 +2989,11 @@ void ha_ndbcluster::start_bulk_insert(ha_rows rows) DBUG_PRINT("enter", ("rows: %d", (int)rows)); m_rows_inserted= 0; - m_rows_to_insert= rows; + if (rows == 0) + /* We don't know how many will be inserted, guess */ + m_rows_to_insert= m_autoincrement_prefetch; + else + m_rows_to_insert= rows; /* Calculate how many rows that should be inserted @@ -4099,6 +4103,10 @@ ulonglong ha_ndbcluster::get_auto_increment() DBUG_ENTER("get_auto_increment"); DBUG_PRINT("enter", ("m_tabname: %s", m_tabname)); Ndb *ndb= get_ndb(); + + if (m_rows_inserted > m_rows_to_insert) + /* We guessed too low */ + m_rows_to_insert+= m_autoincrement_prefetch; cache_size= (m_rows_to_insert - m_rows_inserted < m_autoincrement_prefetch) ? m_rows_to_insert - m_rows_inserted |