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
6f64f66d
Commit
6f64f66d
authored
Sep 20, 2005
by
ramil@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a fix (bug #11553: gives error if aggregate user-defined function in HAVING clause).
parent
6b32d44d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
21 deletions
+42
-21
sql/sql_yacc.yy
sql/sql_yacc.yy
+42
-21
No files found.
sql/sql_yacc.yy
View file @
6f64f66d
...
@@ -4779,27 +4779,48 @@ simple_expr:
...
@@ -4779,27 +4779,48 @@ simple_expr:
$$= new Item_func_sp(Lex->current_context(), name);
$$= new Item_func_sp(Lex->current_context(), name);
lex->safe_to_cache_query=0;
lex->safe_to_cache_query=0;
}
}
| IDENT_sys '('
udf_expr_list ')'
| IDENT_sys '('
{
{
#ifdef HAVE_DLOPEN
#ifdef HAVE_DLOPEN
udf_func *udf;
udf_func *udf= 0;
if (using_udf_functions &&
(udf= find_udf($1.str, $1.length)) &&
udf->type == UDFTYPE_AGGREGATE)
{
LEX *lex= Lex;
if (lex->current_select->inc_in_sum_expr())
{
yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
}
$<udf>$= udf;
#endif
}
udf_expr_list ')'
{
#ifdef HAVE_DLOPEN
udf_func *udf= $<udf>3;
SELECT_LEX *sel= Select;
SELECT_LEX *sel= Select;
if (u
sing_udf_functions && (udf=find_udf($1.str, $1.length))
)
if (u
df
)
{
{
if (udf->type == UDFTYPE_AGGREGATE)
Select->in_sum_expr--;
switch (udf->returns) {
switch (udf->returns) {
case STRING_RESULT:
case STRING_RESULT:
if (udf->type == UDFTYPE_FUNCTION)
if (udf->type == UDFTYPE_FUNCTION)
{
{
if ($
3
!= NULL)
if ($
4
!= NULL)
$$ = new Item_func_udf_str(udf, *$
3
);
$$ = new Item_func_udf_str(udf, *$
4
);
else
else
$$ = new Item_func_udf_str(udf);
$$ = new Item_func_udf_str(udf);
}
}
else
else
{
{
if ($
3
!= NULL)
if ($
4
!= NULL)
$$ = new Item_sum_udf_str(udf, *$
3
);
$$ = new Item_sum_udf_str(udf, *$
4
);
else
else
$$ = new Item_sum_udf_str(udf);
$$ = new Item_sum_udf_str(udf);
}
}
...
@@ -4807,15 +4828,15 @@ simple_expr:
...
@@ -4807,15 +4828,15 @@ simple_expr:
case REAL_RESULT:
case REAL_RESULT:
if (udf->type == UDFTYPE_FUNCTION)
if (udf->type == UDFTYPE_FUNCTION)
{
{
if ($
3
!= NULL)
if ($
4
!= NULL)
$$ = new Item_func_udf_float(udf, *$
3
);
$$ = new Item_func_udf_float(udf, *$
4
);
else
else
$$ = new Item_func_udf_float(udf);
$$ = new Item_func_udf_float(udf);
}
}
else
else
{
{
if ($
3
!= NULL)
if ($
4
!= NULL)
$$ = new Item_sum_udf_float(udf, *$
3
);
$$ = new Item_sum_udf_float(udf, *$
4
);
else
else
$$ = new Item_sum_udf_float(udf);
$$ = new Item_sum_udf_float(udf);
}
}
...
@@ -4823,15 +4844,15 @@ simple_expr:
...
@@ -4823,15 +4844,15 @@ simple_expr:
case INT_RESULT:
case INT_RESULT:
if (udf->type == UDFTYPE_FUNCTION)
if (udf->type == UDFTYPE_FUNCTION)
{
{
if ($
3
!= NULL)
if ($
4
!= NULL)
$$ = new Item_func_udf_int(udf, *$
3
);
$$ = new Item_func_udf_int(udf, *$
4
);
else
else
$$ = new Item_func_udf_int(udf);
$$ = new Item_func_udf_int(udf);
}
}
else
else
{
{
if ($
3
!= NULL)
if ($
4
!= NULL)
$$ = new Item_sum_udf_int(udf, *$
3
);
$$ = new Item_sum_udf_int(udf, *$
4
);
else
else
$$ = new Item_sum_udf_int(udf);
$$ = new Item_sum_udf_int(udf);
}
}
...
@@ -4839,15 +4860,15 @@ simple_expr:
...
@@ -4839,15 +4860,15 @@ simple_expr:
case DECIMAL_RESULT:
case DECIMAL_RESULT:
if (udf->type == UDFTYPE_FUNCTION)
if (udf->type == UDFTYPE_FUNCTION)
{
{
if ($
3
!= NULL)
if ($
4
!= NULL)
$$ = new Item_func_udf_decimal(udf, *$
3
);
$$ = new Item_func_udf_decimal(udf, *$
4
);
else
else
$$ = new Item_func_udf_decimal(udf);
$$ = new Item_func_udf_decimal(udf);
}
}
else
else
{
{
if ($
3
!= NULL)
if ($
4
!= NULL)
$$ = new Item_sum_udf_decimal(udf, *$
3
);
$$ = new Item_sum_udf_decimal(udf, *$
4
);
else
else
$$ = new Item_sum_udf_decimal(udf);
$$ = new Item_sum_udf_decimal(udf);
}
}
...
@@ -4863,8 +4884,8 @@ simple_expr:
...
@@ -4863,8 +4884,8 @@ simple_expr:
sp_name *name= sp_name_current_db_new(YYTHD, $1);
sp_name *name= sp_name_current_db_new(YYTHD, $1);
sp_add_used_routine(lex, YYTHD, name, TYPE_ENUM_FUNCTION);
sp_add_used_routine(lex, YYTHD, name, TYPE_ENUM_FUNCTION);
if ($
3
)
if ($
4
)
$$= new Item_func_sp(Lex->current_context(), name, *$
3
);
$$= new Item_func_sp(Lex->current_context(), name, *$
4
);
else
else
$$= new Item_func_sp(Lex->current_context(), name);
$$= new Item_func_sp(Lex->current_context(), name);
lex->safe_to_cache_query=0;
lex->safe_to_cache_query=0;
...
...
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