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
87c60ca3
Commit
87c60ca3
authored
Aug 09, 2003
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed union unlocking problem (BUG#906)
parent
a057f75b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
2 deletions
+29
-2
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+12
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+15
-1
sql/sql_union.cc
sql/sql_union.cc
+2
-1
No files found.
mysql-test/r/subselect.result
View file @
87c60ca3
...
...
@@ -1225,3 +1225,15 @@ a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 an
2 2
1 2
drop table t1,t2,t3;
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 @
87c60ca3
...
...
@@ -807,6 +807,7 @@ INSERT INTO t1 VALUES("2f6161e879db43c1a5b82c21ddc49089", "Default", "System", "
INSERT
INTO
t1
VALUES
(
"c373e9f5ad0791724315444553544200"
,
"AddDocumentTest"
,
"admin"
,
"2003-06-09 10:51:25"
,
"Movie Reviews"
,
"0"
,
"2003-06-09 10:51:25"
,
"admin"
,
"0"
,
"2f6161e879db43c1a5b82c21ddc49089"
,
"03eea05112b845949f3fd03278b5fe43"
,
NULL
);
SELECT
'c373e9f5ad0791a0dab5444553544200'
IN
(
SELECT
t1
.
FOLDERID
FROM
t1
WHERE
t1
.
PARENTID
=
'2f6161e879db43c1a5b82c21ddc49089'
AND
t1
.
FOLDERNAME
=
'Level1'
);
drop
table
t1
;
#
# alloc_group_fields() working
#
...
...
@@ -817,4 +818,17 @@ insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10);
insert
into
t2
values
(
0
,
0
),
(
1
,
1
),
(
2
,
1
),
(
3
,
1
),
(
4
,
1
);
insert
into
t3
values
(
3
,
3
),
(
2
,
2
),
(
1
,
1
);
select
a
,(
select
count
(
distinct
t1
.
b
)
as
sum
from
t1
,
t2
where
t1
.
a
=
t2
.
a
and
t2
.
b
>
0
and
t1
.
a
<=
t3
.
b
group
by
t1
.
a
order
by
sum
limit
1
)
from
t3
;
drop
table
t1
,
t2
,
t3
;
s
drop
table
t1
,
t2
,
t3
;
#
# 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 @
87c60ca3
...
...
@@ -351,7 +351,8 @@ int st_select_lex_unit::exec()
global_parameters
->
order_list
.
elements
,
(
ORDER
*
)
global_parameters
->
order_list
.
first
,
(
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
)
thd
->
limit_found_rows
=
(
ulonglong
)
table
->
file
->
records
;
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