MCPcopy Create free account
hub / github.com/MariaDB/server / restore_auto_increment

Method restore_auto_increment

sql/handler.h:4639–4653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4637 next_insert_id= id;
4638 }
4639 virtual void restore_auto_increment(ulonglong prev_insert_id)
4640 {
4641 /*
4642 Insertion of a row failed, re-use the lastly generated auto_increment
4643 id, for the next row. This is achieved by resetting next_insert_id to
4644 what it was before the failed insertion (that old value is provided by
4645 the caller). If that value was 0, it was the first row of the INSERT;
4646 then if insert_id_for_cur_row contains 0 it means no id was generated
4647 for this first row, so no id was generated since the INSERT started, so
4648 we should set next_insert_id to 0; if insert_id_for_cur_row is not 0, it
4649 is the generated id of the first and failed row, so we use it.
4650 */
4651 next_insert_id= (prev_insert_id > 0) ? prev_insert_id :
4652 insert_id_for_cur_row;
4653 }
4654
4655 virtual void update_create_info(HA_CREATE_INFO *create_info) {}
4656 virtual int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt)

Callers 6

single_insertMethod · 0.45
restore_on_errorMethod · 0.45
period_make_insertMethod · 0.45
copy_data_between_tablesFunction · 0.45
update_portion_of_timeFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected