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
759843ae
Commit
759843ae
authored
Dec 23, 2017
by
Sergei Golubchik
Committed by
Eugene Kosov
Dec 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dead code prev_insert_id()
parent
0fe67f2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
39 deletions
+0
-39
sql/handler.cc
sql/handler.cc
+0
-39
No files found.
sql/handler.cc
View file @
759843ae
...
...
@@ -3059,45 +3059,6 @@ void handler::adjust_next_insert_id_after_explicit_value(ulonglong nr)
}
/** @brief
Computes the largest number X:
- smaller than or equal to "nr"
- of the form: auto_increment_offset + N * auto_increment_increment
where N>=0.
SYNOPSIS
prev_insert_id
nr Number to "round down"
variables variables struct containing auto_increment_increment and
auto_increment_offset
RETURN
The number X if it exists, "nr" otherwise.
*/
inline
ulonglong
prev_insert_id
(
ulonglong
nr
,
struct
system_variables
*
variables
)
{
if
(
unlikely
(
nr
<
variables
->
auto_increment_offset
))
{
/*
There's nothing good we can do here. That is a pathological case, where
the offset is larger than the column's max possible value, i.e. not even
the first sequence value may be inserted. User will receive warning.
*/
DBUG_PRINT
(
"info"
,(
"auto_increment: nr: %lu cannot honour "
"auto_increment_offset: %lu"
,
(
ulong
)
nr
,
variables
->
auto_increment_offset
));
return
nr
;
}
if
(
variables
->
auto_increment_increment
==
1
)
return
nr
;
// optimization of the formula below
nr
=
(((
nr
-
variables
->
auto_increment_offset
))
/
(
ulonglong
)
variables
->
auto_increment_increment
);
return
(
nr
*
(
ulonglong
)
variables
->
auto_increment_increment
+
variables
->
auto_increment_offset
);
}
/**
Update the auto_increment field if necessary.
...
...
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