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
1fc33b05
Commit
1fc33b05
authored
Aug 18, 2005
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into moonbone.local:/work/10624-bug-5.0-mysql
parents
6c3dafd0
69319f17
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
mysql-test/r/view.result
mysql-test/r/view.result
+12
-0
mysql-test/t/view.test
mysql-test/t/view.test
+12
-0
sql/sql_lex.cc
sql/sql_lex.cc
+4
-1
No files found.
mysql-test/r/view.result
View file @
1fc33b05
...
@@ -2097,3 +2097,15 @@ select * from v1;
...
@@ -2097,3 +2097,15 @@ select * from v1;
f1
f1
1
1
drop view v1;
drop view v1;
create table t1 (f1 int);
create table t2 (f1 int);
insert into t1 values (1);
insert into t2 values (2);
create view v1 as select * from t1 union select * from t2 union all select * from t2;
select * from v1;
f1
1
2
2
drop view v1;
drop table t1,t2;
mysql-test/t/view.test
View file @
1fc33b05
...
@@ -1942,3 +1942,15 @@ DROP TABLE t1,t2,t3,t4,t5;
...
@@ -1942,3 +1942,15 @@ DROP TABLE t1,t2,t3,t4,t5;
create
view
v1
as
select
timestampdiff
(
day
,
'1997-01-01 00:00:00'
,
'1997-01-02 00:00:00'
)
as
f1
;
create
view
v1
as
select
timestampdiff
(
day
,
'1997-01-01 00:00:00'
,
'1997-01-02 00:00:00'
)
as
f1
;
select
*
from
v1
;
select
*
from
v1
;
drop
view
v1
;
drop
view
v1
;
#
# Bug #10624 Views with multiple UNION and UNION ALL produce incorrect results
#
create
table
t1
(
f1
int
);
create
table
t2
(
f1
int
);
insert
into
t1
values
(
1
);
insert
into
t2
values
(
2
);
create
view
v1
as
select
*
from
t1
union
select
*
from
t2
union
all
select
*
from
t2
;
select
*
from
v1
;
drop
view
v1
;
drop
table
t1
,
t2
;
sql/sql_lex.cc
View file @
1fc33b05
...
@@ -1511,13 +1511,16 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num)
...
@@ -1511,13 +1511,16 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num)
void
st_select_lex_unit
::
print
(
String
*
str
)
void
st_select_lex_unit
::
print
(
String
*
str
)
{
{
bool
union_all
=
!
union_distinct
;
for
(
SELECT_LEX
*
sl
=
first_select
();
sl
;
sl
=
sl
->
next_select
())
for
(
SELECT_LEX
*
sl
=
first_select
();
sl
;
sl
=
sl
->
next_select
())
{
{
if
(
sl
!=
first_select
())
if
(
sl
!=
first_select
())
{
{
str
->
append
(
" union "
,
7
);
str
->
append
(
" union "
,
7
);
if
(
!
union_distinct
)
if
(
union_all
)
str
->
append
(
"all "
,
4
);
str
->
append
(
"all "
,
4
);
else
if
(
union_distinct
==
sl
)
union_all
=
true
;
}
}
if
(
sl
->
braces
)
if
(
sl
->
braces
)
str
->
append
(
'('
);
str
->
append
(
'('
);
...
...
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