diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 3f5712d5197..de47bee275e 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -18534,9 +18534,15 @@ dberr_t ha_innobase::innobase_get_autoinc( return (m_prebuilt->autoinc_error); } +void ha_innobase::release_auto_increment() { + trx_t *trx = thd_to_trx(m_user_thd); + TrxInInnoDB trx_in_innodb(trx); + if (trx->n_autoinc_rows > 0) { + trx->n_autoinc_rows = 0; + } +} /** Returns the value of the auto-inc counter in *first_value and ~0 on failure. */ - void ha_innobase::get_auto_increment( ulonglong offset, /*!< in: table autoinc offset */ ulonglong increment, /*!< in: table autoinc diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index f0712bf7ecc..d4d8fbdd7ff 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -686,6 +686,8 @@ class ha_innobase : public handler { public: virtual void get_create_info(const char *table, const dd::Table *table_def, HA_CREATE_INFO *create_info); + + virtual void release_auto_increment(); }; struct trx_t;