1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-17137: Syntax errors with VIEW using MEDIAN

The syntax error happened because we had not implemented a different print for
percentile functions. The syntax is a bit different when we use percentile functions
as window functions in comparision to normal window functions.
Implemented a seperate print function for percentile functions
This commit is contained in:
Varun Gupta
2018-10-15 09:35:19 -07:00
parent 103b1df510
commit 97a37edc97
6 changed files with 66 additions and 3 deletions

View File

@ -82,19 +82,32 @@ void
Window_spec::print(String *str, enum_query_type query_type)
{
str->append('(');
print_partition(str, query_type);
print_order(str, query_type);
if (window_frame)
window_frame->print(str, query_type);
str->append(')');
}
void
Window_spec::print_partition(String *str, enum_query_type query_type)
{
if (partition_list->first)
{
str->append(STRING_WITH_LEN(" partition by "));
st_select_lex::print_order(str, partition_list->first, query_type);
}
}
void
Window_spec::print_order(String *str, enum_query_type query_type)
{
if (order_list->first)
{
str->append(STRING_WITH_LEN(" order by "));
st_select_lex::print_order(str, order_list->first, query_type);
}
if (window_frame)
window_frame->print(str, query_type);
str->append(')');
}
bool