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
57ca4fac
Commit
57ca4fac
authored
Nov 02, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into moonbone.local:/work/14466-bug-5.0-mysql
parents
3c76331f
7dd86f75
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
mysql-test/r/view.result
mysql-test/r/view.result
+12
-0
mysql-test/t/view.test
mysql-test/t/view.test
+11
-1
sql/item_sum.cc
sql/item_sum.cc
+4
-0
No files found.
mysql-test/r/view.result
View file @
57ca4fac
...
...
@@ -2323,3 +2323,15 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
DROP VIEW v1,v2;
DROP TABLE t1,t2,t3;
create table t1 (f1 int, f2 int);
insert into t1 values(1,1),(1,2),(1,3);
create view v1 as select f1 ,group_concat(f2 order by f2 asc) from t1 group by f1;
create view v2 as select f1 ,group_concat(f2 order by f2 desc) from t1 group by f1;
select * from v1;
f1 group_concat(f2 order by f2 asc)
1 1,2,3
select * from v2;
f1 group_concat(f2 order by f2 desc)
1 3,2,1
drop view v1,v2;
drop table t1;
mysql-test/t/view.test
View file @
57ca4fac
...
...
@@ -2189,4 +2189,14 @@ EXPLAIN SELECT * FROM v2 WHERE a=1;
DROP
VIEW
v1
,
v2
;
DROP
TABLE
t1
,
t2
,
t3
;
#
# Bug #14466 lost sort order in GROUP_CONCAT() in a view
#
create
table
t1
(
f1
int
,
f2
int
);
insert
into
t1
values
(
1
,
1
),(
1
,
2
),(
1
,
3
);
create
view
v1
as
select
f1
,
group_concat
(
f2
order
by
f2
asc
)
from
t1
group
by
f1
;
create
view
v2
as
select
f1
,
group_concat
(
f2
order
by
f2
desc
)
from
t1
group
by
f1
;
select
*
from
v1
;
select
*
from
v2
;
drop
view
v1
,
v2
;
drop
table
t1
;
sql/item_sum.cc
View file @
57ca4fac
...
...
@@ -3173,6 +3173,10 @@ void Item_func_group_concat::print(String *str)
if
(
i
)
str
->
append
(
','
);
(
*
order
[
i
]
->
item
)
->
print
(
str
);
if
(
order
[
i
]
->
asc
)
str
->
append
(
" ASC"
);
else
str
->
append
(
" DESC"
);
}
}
str
->
append
(
" separator
\'
"
,
12
);
...
...
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