diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index fb632d1347e..be2646d4fc4 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -1461,6 +1461,11 @@ error_exit: with a latch. */ dict_table_n_rows_inc(table); + if (prebuilt->clust_index_was_generated) { + /* set row id to prebuilt */ + ut_memcpy(prebuilt->row_id, node->row_id_buf, DATA_ROW_ID_LEN); + } + row_update_statistics_if_needed(table); trx->op_info = ""; diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc index ec4f865c6b3..fefd295f79d 100644 --- a/storage/xtradb/row/row0mysql.cc +++ b/storage/xtradb/row/row0mysql.cc @@ -1455,6 +1455,11 @@ error_exit: srv_stats.n_rows_inserted.add((size_t)trx->id, 1); } + if (prebuilt->clust_index_was_generated) { + /* set row id to prebuilt */ + ut_memcpy(prebuilt->row_id, node->row_id_buf, DATA_ROW_ID_LEN); + } + /* Not protected by dict_table_stats_lock() for performance reasons, we would rather get garbage in stat_n_rows (which is just an estimate anyway) than protecting the following code