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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0b6dc493
Commit
0b6dc493
authored
Sep 17, 2004
by
antony@ltantony.rdg.cyberkinetica.homeunix.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#5553 - Multi table UPDATE IGNORE fails on dup key
We don't want the update to abort when IGNORE is specified
parent
6083e00d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
2 deletions
+77
-2
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
mysql-test/r/update.result
mysql-test/r/update.result
+37
-0
mysql-test/t/update.test
mysql-test/t/update.test
+33
-0
sql/sql_update.cc
sql/sql_update.cc
+6
-2
No files found.
BitKeeper/etc/logging_ok
View file @
0b6dc493
...
@@ -9,6 +9,7 @@ acurtis@pcgem.rdg.cyberkinetica.com
...
@@ -9,6 +9,7 @@ acurtis@pcgem.rdg.cyberkinetica.com
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
akishkin@work.mysql.com
akishkin@work.mysql.com
antony@ltantony.dsl-verizon.net
antony@ltantony.dsl-verizon.net
antony@ltantony.rdg.cyberkinetica.homeunix.net
arjen@bitbike.com
arjen@bitbike.com
arjen@co3064164-a.bitbike.com
arjen@co3064164-a.bitbike.com
arjen@fred.bitbike.com
arjen@fred.bitbike.com
...
...
mysql-test/r/update.result
View file @
0b6dc493
...
@@ -166,3 +166,40 @@ F1 F2 F3 cnt groupid
...
@@ -166,3 +166,40 @@ F1 F2 F3 cnt groupid
2 0 1 2 4
2 0 1 2 4
2 2 0 1 7
2 2 0 1 7
drop table t1;
drop table t1;
CREATE TABLE t1 (
`colA` int(10) unsigned NOT NULL auto_increment,
`colB` int(11) NOT NULL default '0',
PRIMARY KEY (`colA`)
);
INSERT INTO t1 VALUES (4433,5424);
CREATE TABLE t2 (
`colC` int(10) unsigned NOT NULL default '0',
`colA` int(10) unsigned NOT NULL default '0',
`colD` int(10) unsigned NOT NULL default '0',
`colE` int(10) unsigned NOT NULL default '0',
`colF` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`colC`,`colA`,`colD`,`colE`)
);
INSERT INTO t2 VALUES (3,4433,10005,495,500);
INSERT INTO t2 VALUES (3,4433,10005,496,500);
INSERT INTO t2 VALUES (3,4433,10009,494,500);
INSERT INTO t2 VALUES (3,4433,10011,494,500);
INSERT INTO t2 VALUES (3,4433,10005,497,500);
INSERT INTO t2 VALUES (3,4433,10013,489,500);
INSERT INTO t2 VALUES (3,4433,10005,494,500);
INSERT INTO t2 VALUES (3,4433,10005,493,500);
INSERT INTO t2 VALUES (3,4433,10005,492,500);
UPDATE IGNORE t2,t1 set t2.colE = t2.colE + 1,colF=0 WHERE t1.colA = t2.colA AND (t1.colB & 4096) > 0 AND (colE + 1) < colF;
SELECT * FROM t2;
colC colA colD colE colF
3 4433 10005 495 500
3 4433 10005 496 500
3 4433 10009 495 0
3 4433 10011 495 0
3 4433 10005 498 0
3 4433 10013 490 0
3 4433 10005 494 500
3 4433 10005 493 500
3 4433 10005 492 500
DROP TABLE t1;
DROP TABLE t2;
mysql-test/t/update.test
View file @
0b6dc493
...
@@ -122,3 +122,36 @@ insert into t1 (F1,F2,F3,cnt,groupid) values ('0','0','0',1,6),
...
@@ -122,3 +122,36 @@ insert into t1 (F1,F2,F3,cnt,groupid) values ('0','0','0',1,6),
delete
from
t1
using
t1
m1
,
t1
m2
where
m1
.
groupid
=
m2
.
groupid
and
(
m1
.
cnt
<
m2
.
cnt
or
m1
.
cnt
=
m2
.
cnt
and
m1
.
F3
>
m2
.
F3
);
delete
from
t1
using
t1
m1
,
t1
m2
where
m1
.
groupid
=
m2
.
groupid
and
(
m1
.
cnt
<
m2
.
cnt
or
m1
.
cnt
=
m2
.
cnt
and
m1
.
F3
>
m2
.
F3
);
select
*
from
t1
;
select
*
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Bug#5553 - Multi table UPDATE IGNORE fails on duplicate keys
#
CREATE
TABLE
t1
(
`colA`
int
(
10
)
unsigned
NOT
NULL
auto_increment
,
`colB`
int
(
11
)
NOT
NULL
default
'0'
,
PRIMARY
KEY
(
`colA`
)
);
INSERT
INTO
t1
VALUES
(
4433
,
5424
);
CREATE
TABLE
t2
(
`colC`
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
`colA`
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
`colD`
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
`colE`
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
`colF`
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
PRIMARY
KEY
(
`colC`
,
`colA`
,
`colD`
,
`colE`
)
);
INSERT
INTO
t2
VALUES
(
3
,
4433
,
10005
,
495
,
500
);
INSERT
INTO
t2
VALUES
(
3
,
4433
,
10005
,
496
,
500
);
INSERT
INTO
t2
VALUES
(
3
,
4433
,
10009
,
494
,
500
);
INSERT
INTO
t2
VALUES
(
3
,
4433
,
10011
,
494
,
500
);
INSERT
INTO
t2
VALUES
(
3
,
4433
,
10005
,
497
,
500
);
INSERT
INTO
t2
VALUES
(
3
,
4433
,
10013
,
489
,
500
);
INSERT
INTO
t2
VALUES
(
3
,
4433
,
10005
,
494
,
500
);
INSERT
INTO
t2
VALUES
(
3
,
4433
,
10005
,
493
,
500
);
INSERT
INTO
t2
VALUES
(
3
,
4433
,
10005
,
492
,
500
);
UPDATE
IGNORE
t2
,
t1
set
t2
.
colE
=
t2
.
colE
+
1
,
colF
=
0
WHERE
t1
.
colA
=
t2
.
colA
AND
(
t1
.
colB
&
4096
)
>
0
AND
(
colE
+
1
)
<
colF
;
SELECT
*
FROM
t2
;
DROP
TABLE
t1
;
DROP
TABLE
t2
;
sql/sql_update.cc
View file @
0b6dc493
...
@@ -792,9 +792,13 @@ bool multi_update::send_data(List<Item> ¬_used_values)
...
@@ -792,9 +792,13 @@ bool multi_update::send_data(List<Item> ¬_used_values)
if
((
error
=
table
->
file
->
update_row
(
table
->
record
[
1
],
if
((
error
=
table
->
file
->
update_row
(
table
->
record
[
1
],
table
->
record
[
0
])))
table
->
record
[
0
])))
{
{
table
->
file
->
print_error
(
error
,
MYF
(
0
));
updated
--
;
updated
--
;
DBUG_RETURN
(
1
);
if
(
handle_duplicates
!=
DUP_IGNORE
||
error
!=
HA_ERR_FOUND_DUPP_KEY
)
{
table
->
file
->
print_error
(
error
,
MYF
(
0
));
DBUG_RETURN
(
1
);
}
}
}
}
}
}
}
...
...
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