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
7368605c
Commit
7368605c
authored
Dec 02, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/15028-bug-4.1-mysql
parents
109b0665
e811c864
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
6 deletions
+37
-6
mysql-test/r/update.result
mysql-test/r/update.result
+13
-0
mysql-test/t/update.test
mysql-test/t/update.test
+17
-0
sql/sql_update.cc
sql/sql_update.cc
+7
-6
No files found.
mysql-test/r/update.result
View file @
7368605c
...
...
@@ -345,3 +345,16 @@ f1
2000-01-01
2002-02-02
drop table t1;
create table t1 (f1 int);
create table t2 (f2 int);
insert into t1 values(1),(2);
insert into t2 values(1),(1);
update t1,t2 set f1=3,f2=3 where f1=f2 and f1=1;
affected rows: 3
info: Rows matched: 3 Changed: 3 Warnings: 0
update t2 set f2=1;
update t1 set f1=1 where f1=3;
update t2,t1 set f1=3,f2=3 where f1=f2 and f1=1;
affected rows: 3
info: Rows matched: 3 Changed: 3 Warnings: 0
drop table t1,t2;
mysql-test/t/update.test
View file @
7368605c
...
...
@@ -270,4 +270,21 @@ insert into t1 values('2000-01-01'),('0000-00-00');
update
t1
set
f1
=
'2002-02-02'
where
f1
is
null
;
select
*
from
t1
;
drop
table
t1
;
#
# Bug#15028 Multitable update returns different numbers of matched rows
# depending on table order
create
table
t1
(
f1
int
);
create
table
t2
(
f2
int
);
insert
into
t1
values
(
1
),(
2
);
insert
into
t2
values
(
1
),(
1
);
--
enable_info
update
t1
,
t2
set
f1
=
3
,
f2
=
3
where
f1
=
f2
and
f1
=
1
;
--
disable_info
update
t2
set
f2
=
1
;
update
t1
set
f1
=
1
where
f1
=
3
;
--
enable_info
update
t2
,
t1
set
f1
=
3
,
f2
=
3
where
f1
=
f2
and
f1
=
1
;
--
disable_info
drop
table
t1
,
t2
;
# End of 4.1 tests
sql/sql_update.cc
View file @
7368605c
...
...
@@ -1082,22 +1082,23 @@ bool multi_update::send_data(List<Item> ¬_used_values)
int
error
;
TABLE
*
tmp_table
=
tmp_tables
[
offset
];
fill_record
(
tmp_table
->
field
+
1
,
*
values_for_table
[
offset
],
1
);
found
++
;
/* Store pointer to row */
memcpy
((
char
*
)
tmp_table
->
field
[
0
]
->
ptr
,
(
char
*
)
table
->
file
->
ref
,
table
->
file
->
ref_length
);
/* Write row, ignoring duplicated updates to a row */
if
((
error
=
tmp_table
->
file
->
write_row
(
tmp_table
->
record
[
0
]))
&&
(
error
!=
HA_ERR_FOUND_DUPP_KEY
&&
error
!=
HA_ERR_FOUND_DUPP_UNIQUE
))
if
(
error
=
tmp_table
->
file
->
write_row
(
tmp_table
->
record
[
0
]))
{
if
(
create_myisam_from_heap
(
thd
,
tmp_table
,
tmp_table_param
+
offset
,
error
,
1
))
if
(
error
!=
HA_ERR_FOUND_DUPP_KEY
&&
error
!=
HA_ERR_FOUND_DUPP_UNIQUE
&&
create_myisam_from_heap
(
thd
,
tmp_table
,
tmp_table_param
+
offset
,
error
,
1
))
{
do_update
=
0
;
DBUG_RETURN
(
1
);
// Not a table_is_full error
}
}
else
found
++
;
}
}
DBUG_RETURN
(
0
);
...
...
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