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
2db574ea
Commit
2db574ea
authored
Jan 29, 2003
by
heikki@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ha_innodb.cc:
Fix a bug REPLACE INTO t SELECT ... did not work if t has an auto-inc column
parent
769e60c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
sql/ha_innodb.cc
sql/ha_innodb.cc
+13
-3
No files found.
sql/ha_innodb.cc
View file @
2db574ea
...
...
@@ -1733,6 +1733,7 @@ ha_innobase::write_row(
ibool
incremented_auto_inc_for_stat
=
FALSE
;
ibool
incremented_auto_inc_counter
=
FALSE
;
ibool
skip_auto_inc_decr
;
ibool
success
;
DBUG_ENTER
(
"ha_innobase::write_row"
);
...
...
@@ -1908,9 +1909,18 @@ ha_innobase::write_row(
the counter here. */
skip_auto_inc_decr
=
FALSE
;
if
(
error
==
DB_DUPLICATE_KEY
&&
user_thd
->
lex
.
sql_command
==
SQLCOM_REPLACE
)
skip_auto_inc_decr
=
TRUE
;
/* Note that MySQL classifies in lex.sql_command a query
of type REPLACE INTO ... SELECT as simply SQLCOM_QUERY.
We have to scan the query string if the query is actually
a REPLACE. */
dict_accept
(
user_thd
->
query
,
"REPLACE"
,
&
success
);
if
(
error
==
DB_DUPLICATE_KEY
&&
success
)
{
skip_auto_inc_decr
=
TRUE
;
}
if
(
!
skip_auto_inc_decr
&&
incremented_auto_inc_counter
&&
prebuilt
->
trx
->
auto_inc_lock
)
{
...
...
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