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
687417be
Commit
687417be
authored
May 07, 2005
by
antony@ltantony.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge ltantony.mysql.com:/usr/home/antony/work2/p2-bug9725
into ltantony.mysql.com:/usr/home/antony/work2/megapatch-4.1
parents
b0196446
1ebc9e37
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
mysql-test/r/insert_update.result
mysql-test/r/insert_update.result
+13
-0
mysql-test/t/insert_update.test
mysql-test/t/insert_update.test
+12
-0
sql/sql_insert.cc
sql/sql_insert.cc
+4
-0
No files found.
mysql-test/r/insert_update.result
View file @
687417be
...
@@ -167,3 +167,16 @@ a b c VALUES(a)
...
@@ -167,3 +167,16 @@ a b c VALUES(a)
2 1 11 NULL
2 1 11 NULL
DROP TABLE t1;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t2;
create table t1 (a int not null unique);
insert into t1 values (1),(2);
insert ignore into t1 select 1 on duplicate key update a=2;
select * from t1;
a
1
2
insert ignore into t1 select a from t1 on duplicate key update a=a+1 ;
select * from t1;
a
1
3
drop table t1;
mysql-test/t/insert_update.test
View file @
687417be
...
@@ -80,3 +80,15 @@ INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a);
...
@@ -80,3 +80,15 @@ INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a);
SELECT
*
,
VALUES
(
a
)
FROM
t1
;
SELECT
*
,
VALUES
(
a
)
FROM
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t2
;
DROP
TABLE
t2
;
#
# Bug#9725 - "disapearing query/hang" and "unknown error" with "on duplicate key update"
# INSERT INGORE...UPDATE gives bad error or breaks protocol.
#
create
table
t1
(
a
int
not
null
unique
);
insert
into
t1
values
(
1
),(
2
);
insert
ignore
into
t1
select
1
on
duplicate
key
update
a
=
2
;
select
*
from
t1
;
insert
ignore
into
t1
select
a
from
t1
on
duplicate
key
update
a
=
a
+
1
;
select
*
from
t1
;
drop
table
t1
;
sql/sql_insert.cc
View file @
687417be
...
@@ -632,7 +632,11 @@ int write_record(TABLE *table,COPY_INFO *info)
...
@@ -632,7 +632,11 @@ int write_record(TABLE *table,COPY_INFO *info)
if
(
fill_record
(
*
info
->
update_fields
,
*
info
->
update_values
,
0
))
if
(
fill_record
(
*
info
->
update_fields
,
*
info
->
update_values
,
0
))
goto
err
;
goto
err
;
if
((
error
=
table
->
file
->
update_row
(
table
->
record
[
1
],
table
->
record
[
0
])))
if
((
error
=
table
->
file
->
update_row
(
table
->
record
[
1
],
table
->
record
[
0
])))
{
if
((
error
==
HA_ERR_FOUND_DUPP_KEY
)
&&
info
->
ignore
)
break
;
goto
err
;
goto
err
;
}
info
->
updated
++
;
info
->
updated
++
;
break
;
break
;
}
}
...
...
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