Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
259edb1f
Commit
259edb1f
authored
Oct 31, 2019
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.1' into 10.2
parents
2ba9a269
1bb85708
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
62 deletions
+0
-62
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+0
-31
storage/xtradb/handler/ha_innodb.cc
storage/xtradb/handler/ha_innodb.cc
+0
-31
No files found.
storage/innobase/handler/ha_innodb.cc
View file @
259edb1f
...
...
@@ -16813,37 +16813,6 @@ ha_innobase::get_auto_increment(
(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
;
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
)
{
...
...
storage/xtradb/handler/ha_innodb.cc
View file @
259edb1f
...
...
@@ -16580,37 +16580,6 @@ ha_innobase::get_auto_increment(
(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
;
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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment