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
371850a4
Commit
371850a4
authored
Mar 18, 2005
by
konstantin@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup of Item_func_group_concat
parent
60e7da0a
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
172 additions
and
211 deletions
+172
-211
mysql-test/r/func_gconcat.result
mysql-test/r/func_gconcat.result
+1
-1
sql/item_sum.cc
sql/item_sum.cc
+151
-183
sql/item_sum.h
sql/item_sum.h
+20
-27
No files found.
mysql-test/r/func_gconcat.result
View file @
371850a4
...
@@ -166,7 +166,7 @@ set group_concat_max_len = 1024;
...
@@ -166,7 +166,7 @@ set group_concat_max_len = 1024;
select group_concat(sum(a)) from t1 group by grp;
select group_concat(sum(a)) from t1 group by grp;
ERROR HY000: Invalid use of group function
ERROR HY000: Invalid use of group function
select grp,group_concat(c order by 2) from t1 group by grp;
select grp,group_concat(c order by 2) from t1 group by grp;
ERROR 42S22: Unknown column '2' in '
group statement
'
ERROR 42S22: Unknown column '2' in '
order clause
'
drop table t1;
drop table t1;
create table t1 ( URL_ID int(11), URL varchar(80));
create table t1 ( URL_ID int(11), URL varchar(80));
create table t2 ( REQ_ID int(11), URL_ID int(11));
create table t2 ( REQ_ID int(11), URL_ID int(11));
...
...
sql/item_sum.cc
View file @
371850a4
This diff is collapsed.
Click to expand it.
sql/item_sum.h
View file @
371850a4
...
@@ -834,15 +834,26 @@ class MYSQL_ERROR;
...
@@ -834,15 +834,26 @@ class MYSQL_ERROR;
class
Item_func_group_concat
:
public
Item_sum
class
Item_func_group_concat
:
public
Item_sum
{
{
THD
*
item_thd
;
TMP_TABLE_PARAM
*
tmp_table_param
;
TMP_TABLE_PARAM
*
tmp_table_param
;
uint
max_elements_in_tree
;
MYSQL_ERROR
*
warning
;
MYSQL_ERROR
*
warning
;
uint
key_length
;
String
result
;
bool
tree_mode
;
String
*
separator
;
TREE
tree_base
;
TREE
*
tree
;
TABLE
*
table
;
ORDER
**
order
;
TABLE_LIST
*
tables_list
;
uint
arg_count_order
;
// total count of ORDER BY items
uint
arg_count_field
;
// count of arguments
uint
count_cut_values
;
bool
distinct
;
bool
distinct
;
bool
warning_for_row
;
bool
warning_for_row
;
bool
always_null
;
bool
always_null
;
/*
Following is 0 normal object and pointer to original one for copy
(to correctly free resources)
*/
Item_func_group_concat
*
original
;
friend
int
group_concat_key_cmp_with_distinct
(
void
*
arg
,
byte
*
key1
,
friend
int
group_concat_key_cmp_with_distinct
(
void
*
arg
,
byte
*
key1
,
byte
*
key2
);
byte
*
key2
);
...
@@ -854,30 +865,12 @@ class Item_func_group_concat : public Item_sum
...
@@ -854,30 +865,12 @@ class Item_func_group_concat : public Item_sum
friend
int
dump_leaf_key
(
byte
*
key
,
uint32
count
__attribute__
((
unused
)),
friend
int
dump_leaf_key
(
byte
*
key
,
uint32
count
__attribute__
((
unused
)),
Item_func_group_concat
*
group_concat_item
);
Item_func_group_concat
*
group_concat_item
);
public:
public:
String
result
;
String
*
separator
;
TREE
tree_base
;
TREE
*
tree
;
TABLE
*
table
;
ORDER
**
order
;
TABLE_LIST
*
tables_list
;
ulong
group_concat_max_len
;
uint
arg_count_order
;
uint
arg_count_field
;
uint
field_list_offset
;
uint
count_cut_values
;
/*
Following is 0 normal object and pointer to original one for copy
(to correctly free resources)
*/
Item_func_group_concat
*
original
;
Item_func_group_concat
(
bool
is_distinct
,
List
<
Item
>
*
is_select
,
Item_func_group_concat
(
bool
is_distinct
,
List
<
Item
>
*
is_select
,
SQL_LIST
*
is_order
,
String
*
is_separator
);
SQL_LIST
*
is_order
,
String
*
is_separator
);
Item_func_group_concat
(
THD
*
thd
,
Item_func_group_concat
*
item
);
Item_func_group_concat
(
THD
*
thd
,
Item_func_group_concat
*
item
);
~
Item_func_group_concat
()
;
~
Item_func_group_concat
()
{}
void
cleanup
();
void
cleanup
();
enum
Sumfunctype
sum_func
()
const
{
return
GROUP_CONCAT_FUNC
;}
enum
Sumfunctype
sum_func
()
const
{
return
GROUP_CONCAT_FUNC
;}
...
@@ -885,11 +878,11 @@ class Item_func_group_concat : public Item_sum
...
@@ -885,11 +878,11 @@ class Item_func_group_concat : public Item_sum
virtual
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
virtual
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
void
clear
();
void
clear
();
bool
add
();
bool
add
();
void
reset_field
();
void
reset_field
()
{}
// not used
void
update_field
()
{}
// not used
bool
fix_fields
(
THD
*
,
TABLE_LIST
*
,
Item
**
);
bool
fix_fields
(
THD
*
,
TABLE_LIST
*
,
Item
**
);
bool
setup
(
THD
*
thd
);
bool
setup
(
THD
*
thd
);
void
make_unique
();
void
make_unique
();
virtual
void
update_field
()
{}
double
val_real
()
double
val_real
()
{
{
String
*
res
;
res
=
val_str
(
&
str_value
);
String
*
res
;
res
=
val_str
(
&
str_value
);
...
...
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