diff options
author | mskold@mysql.com <> | 2005-04-07 17:44:09 +0200 |
---|---|---|
committer | mskold@mysql.com <> | 2005-04-07 17:44:09 +0200 |
commit | 89b140340cf4768d2f693d0d6f264fce429a83c7 (patch) | |
tree | a991ed26c00129bfd3b8a5ba99d810e4f1ba2423 /sql | |
parent | 934f458140dc970ccc4cdb4ebb094f38c8b651c9 (diff) | |
download | mariadb-git-89b140340cf4768d2f693d0d6f264fce429a83c7.tar.gz |
Fix for Bug #9675 Auto-increment not working with INSERT..SELECT and NDB storage
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_ndbcluster.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 7025ac2cd1a..31b16d58b62 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2920,7 +2920,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 @@ -3929,6 +3933,7 @@ longlong ha_ndbcluster::get_auto_increment() DBUG_ENTER("get_auto_increment"); DBUG_PRINT("enter", ("m_tabname: %s", m_tabname)); Ndb *ndb= get_ndb(); + int cache_size= (m_rows_to_insert - m_rows_inserted < m_autoincrement_prefetch) ? m_rows_to_insert - m_rows_inserted |