DeNADev/HandlerSocket-Plugin-for-MySQL — Issue #77: InnoDB's get_auto_increment() is error where insert many row in MySQL 5.5 
Author: zephyrleaves
Created: 2012-02-23 06:56:03+00:00
State: open

In mysql 5.5, HandlerSocket use trans_commit_stmt() in dbcontext::unlock_tables_if(), and didn't commit single statement transaction.
It make the trx->n_autoinc_rows could not be reseted to 0,in a single statement done.
So when insert many row in a epoll_wait time , it will make update_auto_increment() failed and return HA_ERR_AUTOINC_ERANGE ,becase the nr will be 0.

I think should use trans_commit() in in dbcontext::unlock_tables_if(),and use trans_commit_stmt() to commit single statement transaction.