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
9a9811f3
Commit
9a9811f3
authored
Feb 22, 2005
by
bell@51.0.168.192.in-addr.arpa
Browse files
Options
Browse Files
Download
Plain Diff
Merge 51.0.168.192.in-addr.arpa:/Users/bell/mysql/bk/mysql-4.1
into 51.0.168.192.in-addr.arpa:/Users/bell/mysql/bk/work-4.1
parents
c0230f6f
2d3076b6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
2 deletions
+40
-2
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
mysql-test/r/derived.result
mysql-test/r/derived.result
+19
-0
mysql-test/t/derived.test
mysql-test/t/derived.test
+12
-0
sql/sql_derived.cc
sql/sql_derived.cc
+8
-2
No files found.
BitKeeper/etc/logging_ok
View file @
9a9811f3
...
...
@@ -26,6 +26,7 @@ bar@deer.(none)
bar@gw.udmsearch.izhnet.ru
bar@mysql.com
bar@noter.intranet.mysql.r18.ru
bell@51.0.168.192.in-addr.arpa
bell@laptop.sanja.is.com.ua
bell@sanja.is.com.ua
bk@admin.bk
...
...
mysql-test/r/derived.result
View file @
9a9811f3
...
...
@@ -339,3 +339,22 @@ select distinct sum(b) from (select a,b from t1) y group by a;
sum(b)
4
drop table t1;
create table t1(a int);
create table t2(a int);
create table t3(a int);
insert into t1 values(1),(1);
insert into t2 values(2),(2);
insert into t3 values(3),(3);
select * from t1 union distinct select * from t2 union all select * from t3;
a
1
2
3
3
select * from (select * from t1 union distinct select * from t2 union all select * from t3) X;
a
1
2
3
3
drop table t1, t2, t3;
mysql-test/t/derived.test
View file @
9a9811f3
...
...
@@ -224,3 +224,15 @@ select distinct sum(b) from t1 group by a;
select
distinct
sum
(
b
)
from
(
select
a
,
b
from
t1
)
y
group
by
a
;
drop
table
t1
;
#
# test of union subquery in the FROM clause with complex distinct/all (BUG#6565)
#
create
table
t1
(
a
int
);
create
table
t2
(
a
int
);
create
table
t3
(
a
int
);
insert
into
t1
values
(
1
),(
1
);
insert
into
t2
values
(
2
),(
2
);
insert
into
t3
values
(
3
),(
3
);
select
*
from
t1
union
distinct
select
*
from
t2
union
all
select
*
from
t3
;
select
*
from
(
select
*
from
t1
union
distinct
select
*
from
t2
union
all
select
*
from
t3
)
X
;
drop
table
t1
,
t2
,
t3
;
sql/sql_derived.cc
View file @
9a9811f3
...
...
@@ -132,10 +132,16 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
/*
Temp table is created so that it hounours if UNION without ALL is to be
processed
As 'distinct' parameter we always pass FALSE (0), because underlying
query will control distinct condition by itself. Correct test of
distinct underlying query will be is_union &&
!unit->union_distinct->next_select() (i.e. it is union and last distinct
SELECT is last SELECT of UNION).
*/
if
(
!
(
table
=
create_tmp_table
(
thd
,
&
derived_result
->
tmp_table_param
,
unit
->
types
,
(
ORDER
*
)
0
,
is_union
&&
unit
->
union_distinct
,
1
,
FALSE
,
1
,
(
first_select
->
options
|
thd
->
options
|
TMP_TABLE_ALL_COLUMNS
),
HA_POS_ERROR
,
...
...
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