diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-10-31 07:44:18 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-10-31 07:44:18 +0200 |
commit | 1bb857089fdcd3a08cb166cb6d75f3e1dbb76f27 (patch) | |
tree | 90d85ade36c3c87cbd0ca7600a5249d9956dc9bf | |
parent | 313855766f3ce608001d686553ef6e087a70d264 (diff) | |
download | mariadb-git-1bb857089fdcd3a08cb166cb6d75f3e1dbb76f27.tar.gz |
MDEV-20927: Remove duplicated code
In commit d1e6b0bcff0148f474e38002d5c1198726fe7970
some code was supposed to be modified, but instead
it got duplicated. Remove the duplicated copy.
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 31 | ||||
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 31 |
2 files changed, 0 insertions, 62 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index ed15c704373..4de2cdbeaec 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -16017,37 +16017,6 @@ ha_innobase::get_auto_increment( if (increment > 1 && thd_sql_command(user_thd) != SQLCOM_ALTER_TABLE && autoinc < col_max_value) { - ulonglong prev_auto_inc = autoinc; - - autoinc = ((autoinc - 1) + increment - offset)/ increment; - - autoinc = autoinc * increment + offset; - - /* If autoinc exceeds the col_max_value then reset - to old autoinc value. Because in case of non-strict - sql mode, boundary value is not considered as error. */ - - if (autoinc >= col_max_value) { - autoinc = prev_auto_inc; - } - - ut_ad(autoinc > 0); - } - - /** The following logic is needed to avoid duplicate key error - for autoincrement column. - - (1) InnoDB gives the current autoincrement value with respect - to increment and offset value. - - (2) Basically it does compute_next_insert_id() logic inside InnoDB - to avoid the current auto increment value changed by handler layer. - - (3) It is restricted only for insert operations. */ - - if (increment > 1 && thd_sql_command(user_thd) != SQLCOM_ALTER_TABLE - && autoinc < col_max_value) { - ulonglong prev_auto_inc = autoinc; autoinc = ((autoinc - 1) + increment - offset)/ increment; diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 788f039f1c8..2aafb1a44ee 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -16656,37 +16656,6 @@ ha_innobase::get_auto_increment( if (increment > 1 && thd_sql_command(user_thd) != SQLCOM_ALTER_TABLE && autoinc < col_max_value) { - ulonglong prev_auto_inc = autoinc; - - autoinc = ((autoinc - 1) + increment - offset)/ increment; - - autoinc = autoinc * increment + offset; - - /* If autoinc exceeds the col_max_value then reset - to old autoinc value. Because in case of non-strict - sql mode, boundary value is not considered as error. */ - - if (autoinc >= col_max_value) { - autoinc = prev_auto_inc; - } - - ut_ad(autoinc > 0); - } - - /** The following logic is needed to avoid duplicate key error - for autoincrement column. - - (1) InnoDB gives the current autoincrement value with respect - to increment and offset value. - - (2) Basically it does compute_next_insert_id() logic inside InnoDB - to avoid the current auto increment value changed by handler layer. - - (3) It is restricted only for insert operations. */ - - if (increment > 1 && thd_sql_command(user_thd) != SQLCOM_ALTER_TABLE - && autoinc < col_max_value) { - ulonglong prev_auto_inc = autoinc; autoinc = ((autoinc - 1) + increment - offset)/ increment; |