1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-21842 auto_increment does not increment with compound primary key on partitioned table.

The idea of this fix is that it's enough to prevent the
next_auto_inc_val from incrementing if an error, to fix this problem
and also the MDEV-17333.
So this patch basically reverts the existing fix to the MDEV-17333.
This commit is contained in:
Alexey Botchkov
2020-11-23 14:12:30 +04:00
parent eae9311fa2
commit 75e7132fca
8 changed files with 114 additions and 46 deletions

View File

@ -3015,10 +3015,6 @@ 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),
@ -3041,7 +3037,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_prev_insert_id(0)
m_lock_type(F_UNLCK), ha_share(NULL)
{
DBUG_PRINT("info",
("handler created F_UNLCK %d F_RDLCK %d F_WRLCK %d",
@ -3705,16 +3701,6 @@ 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)