diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-10-31 09:07:26 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-10-31 09:07:26 +0100 |
commit | 259edb1f60b5d4e9061a81e90c5a8ec9d0741751 (patch) | |
tree | 72a6297b8b060aab6278b045bacc88291edef8d3 | |
parent | 2ba9a269df1c2321f6fa82ee6215c7ef06cf35e2 (diff) | |
parent | 1bb857089fdcd3a08cb166cb6d75f3e1dbb76f27 (diff) | |
download | mariadb-git-259edb1f60b5d4e9061a81e90c5a8ec9d0741751.tar.gz |
Merge branch '10.1' into 10.2
-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 296bab00f90..8a6a3e3d8fb 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -16816,37 +16816,6 @@ ha_innobase::get_auto_increment( if (increment > 1 && thd_sql_command(m_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(m_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 6714cae71b8..770f3dc2440 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -16583,37 +16583,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; |