diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index d90dfcdc6..1dd473a61 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -275,6 +275,7 @@ MySQL_Session::MySQL_Session() { init(); // we moved this out to allow CHANGE_USER + last_insert_id=0; // #1093 } void MySQL_Session::init() { diff --git a/lib/MySQL_Thread.cpp b/lib/MySQL_Thread.cpp index e544f5f26..43ca81b2f 100644 --- a/lib/MySQL_Thread.cpp +++ b/lib/MySQL_Thread.cpp @@ -4215,6 +4215,8 @@ MySQL_Connection * MySQL_Thread::get_MyConn_local(unsigned int _hid) { void MySQL_Thread::push_MyConn_local(MySQL_Connection *c) { MySrvC *mysrvc=NULL; mysrvc=(MySrvC *)c->parent; + // reset insert_id #1093 + c->mysql->insert_id = 0; if (mysrvc->status==MYSQL_SERVER_STATUS_ONLINE) { if (c->async_state_machine==ASYNC_IDLE) { cached_connections->add(c);