mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
Fixed broken auto_increment
This commit is contained in:
parent
7c38f9d8e7
commit
20a82a1a6a
2 changed files with 5 additions and 1 deletions
|
@ -40,7 +40,7 @@ insert into t1 values
|
|||
(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
|
||||
show table status;
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 ndbcluster 10 Dynamic 9 96 # # 0 # 101 # # # latin1_swedish_ci NULL #
|
||||
t1 ndbcluster 10 Dynamic 9 96 # # 0 # 102 # # # latin1_swedish_ci NULL #
|
||||
select * from t1 order by col1;
|
||||
col1 col2 col3 col4 col5 col6 to_be_deleted
|
||||
0 4 3 5 PENDING 1 7
|
||||
|
|
|
@ -1938,8 +1938,12 @@ int ha_ndbcluster::write_row(byte *record)
|
|||
|
||||
if (has_auto_increment)
|
||||
{
|
||||
THD *thd= table->in_use;
|
||||
|
||||
m_skip_auto_increment= FALSE;
|
||||
update_auto_increment();
|
||||
/* Ensure that handler is always called for auto_increment values */
|
||||
thd->next_insert_id= 0;
|
||||
m_skip_auto_increment= !auto_increment_column_changed;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue