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
c66cc864
Commit
c66cc864
authored
Aug 09, 2003
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
c10d1204
87c60ca3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+12
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+12
-0
sql/sql_union.cc
sql/sql_union.cc
+2
-1
No files found.
mysql-test/r/subselect.result
View file @
c66cc864
...
@@ -1239,3 +1239,15 @@ insert into t2 values (1);
...
@@ -1239,3 +1239,15 @@ insert into t2 values (1);
update t1 set s1 = s1 + 1 where 1 = (select x.s1 as A from t2 WHERE t2.s1 > t1.s1 order by A);
update t1 set s1 = s1 + 1 where 1 = (select x.s1 as A from t2 WHERE t2.s1 > t1.s1 order by A);
ERROR 42S02: Unknown table 'x' in field list
ERROR 42S02: Unknown table 'x' in field list
DROP TABLE t1, t2;
DROP TABLE t1, t2;
create table t1 (a int) type=innodb;
create table t2 (a int) type=innodb;
create table t3 (a int) type=innodb;
insert into t1 values (1),(2),(3),(4);
insert into t2 values (10),(20),(30),(40);
insert into t3 values (1),(2),(10),(50);
select a from t3 where t3.a in (select a from t1 where a <= 3 union select * from t2 where a <= 30);
a
1
2
10
drop table t1,t2;
mysql-test/t/subselect.test
View file @
c66cc864
...
@@ -841,3 +841,15 @@ insert into t2 values (1);
...
@@ -841,3 +841,15 @@ insert into t2 values (1);
update
t1
set
s1
=
s1
+
1
where
1
=
(
select
x
.
s1
as
A
from
t2
WHERE
t2
.
s1
>
t1
.
s1
order
by
A
);
update
t1
set
s1
=
s1
+
1
where
1
=
(
select
x
.
s1
as
A
from
t2
WHERE
t2
.
s1
>
t1
.
s1
order
by
A
);
DROP
TABLE
t1
,
t2
;
DROP
TABLE
t1
,
t2
;
#
# UNION unlocking test
#
create
table
t1
(
a
int
)
type
=
innodb
;
create
table
t2
(
a
int
)
type
=
innodb
;
create
table
t3
(
a
int
)
type
=
innodb
;
insert
into
t1
values
(
1
),(
2
),(
3
),(
4
);
insert
into
t2
values
(
10
),(
20
),(
30
),(
40
);
insert
into
t3
values
(
1
),(
2
),(
10
),(
50
);
select
a
from
t3
where
t3
.
a
in
(
select
a
from
t1
where
a
<=
3
union
select
*
from
t2
where
a
<=
30
);
drop
table
t1
,
t2
;
sql/sql_union.cc
View file @
c66cc864
...
@@ -354,7 +354,8 @@ int st_select_lex_unit::exec()
...
@@ -354,7 +354,8 @@ int st_select_lex_unit::exec()
global_parameters
->
order_list
.
elements
,
global_parameters
->
order_list
.
elements
,
(
ORDER
*
)
global_parameters
->
order_list
.
first
,
(
ORDER
*
)
global_parameters
->
order_list
.
first
,
(
ORDER
*
)
NULL
,
NULL
,
(
ORDER
*
)
NULL
,
(
ORDER
*
)
NULL
,
NULL
,
(
ORDER
*
)
NULL
,
thd
->
options
,
result
,
this
,
fake_select
,
0
);
thd
->
options
|
SELECT_NO_UNLOCK
,
result
,
this
,
fake_select
,
0
);
if
(
found_rows_for_union
&&
!
res
)
if
(
found_rows_for_union
&&
!
res
)
thd
->
limit_found_rows
=
(
ulonglong
)
table
->
file
->
records
;
thd
->
limit_found_rows
=
(
ulonglong
)
table
->
file
->
records
;
fake_select
->
exclude
();
fake_select
->
exclude
();
...
...
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