diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index 4060328bfaf..fa124009150 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -3341,7 +3341,8 @@ void ha_tokudb::start_bulk_insert(ha_rows rows) { if (share->try_table_lock) { if (get_prelock_empty(thd) && may_table_be_empty(transaction)) { - if (using_ignore || is_insert_ignore(thd) || thd->lex->duplicates != DUP_ERROR) { + if (using_ignore || is_insert_ignore(thd) || thd->lex->duplicates != DUP_ERROR + || table->s->next_number_key_offset) { acquire_table_lock(transaction, lock_write); } else { @@ -7589,6 +7590,12 @@ void ha_tokudb::get_auto_increment(ulonglong offset, ulonglong increment, ulongl ulonglong nr; bool over; + if (table->s->next_number_key_offset) + { + handler::get_auto_increment(offset, increment, nb_desired_values, first_value, nb_reserved_values); + DBUG_VOID_RETURN; + } + pthread_mutex_lock(&share->mutex); if (share->auto_inc_create_value > share->last_auto_increment) {