1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2019-10-11 08:41:36 +03:00
161 changed files with 1476 additions and 1018 deletions

View File

@ -3119,6 +3119,10 @@ private:
*/
Handler_share **ha_share;
/** Stores next_insert_id for handling duplicate key errors. */
ulonglong m_prev_insert_id;
public:
handler(handlerton *ht_arg, TABLE_SHARE *share_arg)
:table_share(share_arg), table(0),
@ -3143,7 +3147,7 @@ public:
auto_inc_intervals_count(0),
m_psi(NULL), set_top_table_fields(FALSE), top_table(0),
top_table_field(0), top_table_fields(0),
m_lock_type(F_UNLCK), ha_share(NULL)
m_lock_type(F_UNLCK), ha_share(NULL), m_prev_insert_id(0)
{
DBUG_PRINT("info",
("handler created F_UNLCK %d F_RDLCK %d F_WRLCK %d",
@ -3806,7 +3810,7 @@ public:
DBUG_PRINT("info",("auto_increment: next value %lu", (ulong)id));
next_insert_id= id;
}
void restore_auto_increment(ulonglong prev_insert_id)
virtual void restore_auto_increment(ulonglong prev_insert_id)
{
/*
Insertion of a row failed, re-use the lastly generated auto_increment
@ -3822,6 +3826,16 @@ public:
insert_id_for_cur_row;
}
/** Store and restore next_insert_id over duplicate key errors. */
virtual void store_auto_increment()
{
m_prev_insert_id= next_insert_id;
}
virtual void restore_auto_increment()
{
restore_auto_increment(m_prev_insert_id);
}
virtual void update_create_info(HA_CREATE_INFO *create_info) {}
int check_old_types();
virtual int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt)