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
fcb0ecfa
Commit
fcb0ecfa
authored
Apr 14, 2013
by
Chaithra Gopalareddy
Browse files
Options
Browse Files
Download
Plain Diff
Merge from 5.1 to 5.5
parents
40360f02
4db726c0
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
17 deletions
+42
-17
sql/item_sum.cc
sql/item_sum.cc
+4
-3
sql/item_sum.h
sql/item_sum.h
+3
-2
sql/sql_class.h
sql/sql_class.h
+5
-0
sql/sql_lex.cc
sql/sql_lex.cc
+7
-1
sql/sql_lex.h
sql/sql_lex.h
+4
-2
sql/sql_yacc.yy
sql/sql_yacc.yy
+19
-9
No files found.
sql/item_sum.cc
View file @
fcb0ecfa
...
...
@@ -3009,11 +3009,12 @@ int dump_leaf_key(void* key_arg, element_count count __attribute__((unused)),
Item_func_group_concat
::
Item_func_group_concat
(
Name_resolution_context
*
context_arg
,
bool
distinct_arg
,
List
<
Item
>
*
select_list
,
SQL_I_List
<
ORDER
>
*
order_list
,
String
*
separator_arg
)
const
SQL_I_List
<
ORDER
>
&
order_list
,
String
*
separator_arg
)
:
tmp_table_param
(
0
),
separator
(
separator_arg
),
tree
(
0
),
unique_filter
(
NULL
),
table
(
0
),
order
(
0
),
context
(
context_arg
),
arg_count_order
(
order_list
?
order_list
->
elements
:
0
),
arg_count_order
(
order_list
.
elements
),
arg_count_field
(
select_list
->
elements
),
row_count
(
0
),
distinct
(
distinct_arg
),
...
...
@@ -3053,7 +3054,7 @@ Item_func_group_concat(Name_resolution_context *context_arg,
if
(
arg_count_order
)
{
ORDER
**
order_ptr
=
order
;
for
(
ORDER
*
order_item
=
order_list
->
first
;
for
(
ORDER
*
order_item
=
order_list
.
first
;
order_item
!=
NULL
;
order_item
=
order_item
->
next
)
{
...
...
sql/item_sum.h
View file @
fcb0ecfa
#ifndef ITEM_SUM_INCLUDED
#define ITEM_SUM_INCLUDED
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -1402,7 +1403,7 @@ class Item_func_group_concat : public Item_sum
public:
Item_func_group_concat
(
Name_resolution_context
*
context_arg
,
bool
is_distinct
,
List
<
Item
>
*
is_select
,
SQL_I_List
<
ORDER
>
*
is_order
,
String
*
is_separator
);
const
SQL_I_List
<
ORDER
>
&
is_order
,
String
*
is_separator
);
Item_func_group_concat
(
THD
*
thd
,
Item_func_group_concat
*
item
);
~
Item_func_group_concat
();
...
...
sql/sql_class.h
View file @
fcb0ecfa
...
...
@@ -3673,6 +3673,11 @@ inline bool add_order_to_list(THD *thd, Item *item, bool asc)
return
thd
->
lex
->
current_select
->
add_order_to_list
(
thd
,
item
,
asc
);
}
inline
bool
add_gorder_to_list
(
THD
*
thd
,
Item
*
item
,
bool
asc
)
{
return
thd
->
lex
->
current_select
->
add_gorder_to_list
(
thd
,
item
,
asc
);
}
inline
bool
add_group_to_list
(
THD
*
thd
,
Item
*
item
,
bool
asc
)
{
return
thd
->
lex
->
current_select
->
add_group_to_list
(
thd
,
item
,
asc
);
...
...
sql/sql_lex.cc
View file @
fcb0ecfa
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
/*
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -2066,6 +2067,11 @@ bool st_select_lex::add_order_to_list(THD *thd, Item *item, bool asc)
}
bool
st_select_lex
::
add_gorder_to_list
(
THD
*
thd
,
Item
*
item
,
bool
asc
)
{
return
add_to_list
(
thd
,
gorder_list
,
item
,
asc
);
}
bool
st_select_lex
::
add_item_to_list
(
THD
*
thd
,
Item
*
item
)
{
DBUG_ENTER
(
"st_select_lex::add_item_to_list"
);
...
...
sql/sql_lex.h
View file @
fcb0ecfa
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -727,7 +728,7 @@ public:
const
char
*
type
;
/* type of select for EXPLAIN */
SQL_I_List
<
ORDER
>
order_list
;
/* ORDER clause */
SQL_I_List
<
ORDER
>
*
gorder_list
;
SQL_I_List
<
ORDER
>
gorder_list
;
Item
*
select_limit
,
*
offset_limit
;
/* LIMIT clause parameters */
// Arrays of pointers to top elements of all_fields list
Item
**
ref_pointer_array
;
...
...
@@ -850,6 +851,7 @@ public:
bool
add_group_to_list
(
THD
*
thd
,
Item
*
item
,
bool
asc
);
bool
add_ftfunc_to_list
(
Item_func_match
*
func
);
bool
add_order_to_list
(
THD
*
thd
,
Item
*
item
,
bool
asc
);
bool
add_gorder_to_list
(
THD
*
thd
,
Item
*
item
,
bool
asc
);
TABLE_LIST
*
add_table_to_list
(
THD
*
thd
,
Table_ident
*
table
,
LEX_STRING
*
alias
,
ulong
table_options
,
...
...
sql/sql_yacc.yy
View file @
fcb0ecfa
...
...
@@ -8981,6 +8981,7 @@ sum_expr:
if ($$ == NULL)
MYSQL_YYABORT;
$5->empty();
sel->gorder_list.empty();
}
;
...
...
@@ -9050,18 +9051,27 @@ opt_gconcat_separator:
opt_gorder_clause:
/* empty */
| ORDER_SYM BY
{
Select->gorder_list = NULL;
}
| order_clause
LEX *lex= Lex;
SELECT_LEX *sel= lex->current_select;
if (sel->linkage != GLOBAL_OPTIONS_TYPE &&
sel->olap != UNSPECIFIED_OLAP_TYPE &&
(sel->linkage != UNION_TYPE || sel->braces))
{
SELECT_LEX *select= Select;
select->gorder_list= new (YYTHD->mem_root)
SQL_I_List<ORDER>(select->order_list);
if (select->gorder_list == NULL)
my_error(ER_WRONG_USAGE, MYF(0),
"CUBE/ROLLUP", "ORDER BY");
MYSQL_YYABORT;
select->order_list.empty();
}
}
gorder_list;
;
gorder_list:
gorder_list ',' order_ident order_dir
{ if (add_gorder_to_list(YYTHD, $3,(bool) $4)) MYSQL_YYABORT; }
| order_ident order_dir
{ if (add_gorder_to_list(YYTHD, $1,(bool) $2)) MYSQL_YYABORT; }
;
in_sum_expr:
...
...
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