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
2a55a768
Commit
2a55a768
authored
Jan 20, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
for multy-delete command used same algorithm of table reference (alias)
parent
501ae0bc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
7 deletions
+6
-7
mysql-test/r/multi_update.result
mysql-test/r/multi_update.result
+1
-1
mysql-test/r/update.result
mysql-test/r/update.result
+1
-1
mysql-test/t/multi_update.test
mysql-test/t/multi_update.test
+1
-1
mysql-test/t/update.test
mysql-test/t/update.test
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+2
-3
No files found.
mysql-test/r/multi_update.result
View file @
2a55a768
...
...
@@ -244,7 +244,7 @@ select * from t2;
n d
1 30
1 30
DELETE
t1, t2
FROM t1 a,t2 b where a.n=b.n;
DELETE
a, b
FROM t1 a,t2 b where a.n=b.n;
select * from t1;
n d
3 2
...
...
mysql-test/r/update.result
View file @
2a55a768
...
...
@@ -158,7 +158,7 @@ insert into t1 (F1,F2,F3,cnt,groupid) values ('0','0','0',1,6),
('0','1','2',1,5), ('0','2','0',1,3), ('1','0','1',1,2),
('1','2','1',1,1), ('1','2','2',1,1), ('2','0','1',2,4),
('2','2','0',1,7);
delete from
t
1 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
m
1 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;
F1 F2 F3 cnt groupid
0 0 0 1 6
...
...
mysql-test/t/multi_update.test
View file @
2a55a768
...
...
@@ -218,7 +218,7 @@ select * from t2;
UPDATE
t1
a
,
t2
b
SET
a
.
d
=
b
.
d
,
b
.
d
=
30
WHERE
a
.
n
=
b
.
n
;
select
*
from
t1
;
select
*
from
t2
;
DELETE
t1
,
t2
FROM
t1
a
,
t2
b
where
a
.
n
=
b
.
n
;
DELETE
a
,
b
FROM
t1
a
,
t2
b
where
a
.
n
=
b
.
n
;
select
*
from
t1
;
select
*
from
t2
;
drop
table
t1
,
t2
;
...
...
mysql-test/t/update.test
View file @
2a55a768
...
...
@@ -126,6 +126,6 @@ insert into t1 (F1,F2,F3,cnt,groupid) values ('0','0','0',1,6),
(
'1'
,
'2'
,
'1'
,
1
,
1
),
(
'1'
,
'2'
,
'2'
,
1
,
1
),
(
'2'
,
'0'
,
'1'
,
2
,
4
),
(
'2'
,
'2'
,
'0'
,
1
,
7
);
delete
from
t
1
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
m
1
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
;
drop
table
t1
;
sql/sql_parse.cc
View file @
2a55a768
...
...
@@ -2665,9 +2665,8 @@ mysql_execute_command(THD *thd)
TABLE_LIST
*
walk
;
for
(
walk
=
(
TABLE_LIST
*
)
tables
;
walk
;
walk
=
walk
->
next
)
{
if
((
!
strcmp
(
auxi
->
real_name
,
walk
->
real_name
)
||
!
strcmp
(
auxi
->
real_name
,
walk
->
alias
))
&&
!
strcmp
(
walk
->
db
,
auxi
->
db
))
if
(
!
strcmp
(
auxi
->
real_name
,
walk
->
alias
)
&&
!
strcmp
(
walk
->
db
,
auxi
->
db
))
break
;
}
if
(
!
walk
)
...
...
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