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
712d379b
Commit
712d379b
authored
May 14, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check of item name presence in find_item_in_list (Bug #3752)
parent
94321588
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
mysql-test/r/func_gconcat.result
mysql-test/r/func_gconcat.result
+9
-0
mysql-test/t/func_gconcat.test
mysql-test/t/func_gconcat.test
+10
-0
sql/sql_base.cc
sql/sql_base.cc
+8
-1
No files found.
mysql-test/r/func_gconcat.result
View file @
712d379b
...
...
@@ -301,3 +301,12 @@ a c grp
2 4 4
1 2 5
drop table t1,t2;
CREATE TABLE t1 ( a int );
CREATE TABLE t2 ( a int );
INSERT INTO t1 VALUES (1), (2);
INSERT INTO t2 VALUES (1), (2);
SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t1.a) FROM t1, t2 GROUP BY t1.a;
GROUP_CONCAT(t1.a*t2.a ORDER BY t1.a)
2,1
4,2
DROP TABLE t1, t2;
mysql-test/t/func_gconcat.test
View file @
712d379b
...
...
@@ -179,3 +179,13 @@ select group_concat(c order by (select mid(group_concat(c order by a),1,5) from
select
a
,
c
,(
select
group_concat
(
c
order
by
a
)
from
t2
where
a
=
t1
.
a
)
as
grp
from
t1
order
by
grp
;
drop
table
t1
,
t2
;
#
# group_concat of expression with GROUP BY and external GROUP BY
#
CREATE
TABLE
t1
(
a
int
);
CREATE
TABLE
t2
(
a
int
);
INSERT
INTO
t1
VALUES
(
1
),
(
2
);
INSERT
INTO
t2
VALUES
(
1
),
(
2
);
SELECT
GROUP_CONCAT
(
t1
.
a
*
t2
.
a
ORDER
BY
t1
.
a
)
FROM
t1
,
t2
GROUP
BY
t1
.
a
;
DROP
TABLE
t1
,
t2
;
sql/sql_base.cc
View file @
712d379b
...
...
@@ -2096,7 +2096,14 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
if
(
field_name
&&
item
->
type
()
==
Item
::
FIELD_ITEM
)
{
Item_field
*
item_field
=
(
Item_field
*
)
item
;
if
(
!
my_strcasecmp
(
system_charset_info
,
item_field
->
name
,
field_name
))
/*
In case of group_concat() with ORDER BY condition in the QUERY
item_field can be field of temporary table without item name
(if this field created from expression argument of group_concat()),
=> we have to check presence of name before compare
*/
if
(
item_field
->
name
&&
!
my_strcasecmp
(
system_charset_info
,
item_field
->
name
,
field_name
))
{
if
(
!
table_name
)
{
...
...
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