Commit 0b89c614 authored by Igor Babaev's avatar Igor Babaev

Fixed a problem with --ps-protocol.

Window names has to be resolved only once.
parent 2e4bd440
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
bool bool
Window_spec::check_window_names(List_iterator_fast<Window_spec> &it) Window_spec::check_window_names(List_iterator_fast<Window_spec> &it)
{ {
if (window_names_are_checked)
return false;
char *name= this->name(); char *name= this->name();
char *ref_name= window_reference(); char *ref_name= window_reference();
it.rewind(); it.rewind();
...@@ -54,6 +56,7 @@ Window_spec::check_window_names(List_iterator_fast<Window_spec> &it) ...@@ -54,6 +56,7 @@ Window_spec::check_window_names(List_iterator_fast<Window_spec> &it)
my_error(ER_WRONG_WINDOW_SPEC_NAME, MYF(0), ref_name); my_error(ER_WRONG_WINDOW_SPEC_NAME, MYF(0), ref_name);
return true; return true;
} }
window_names_are_checked= true;
return false; return false;
} }
......
...@@ -88,6 +88,8 @@ class Window_frame : public Sql_alloc ...@@ -88,6 +88,8 @@ class Window_frame : public Sql_alloc
class Window_spec : public Sql_alloc class Window_spec : public Sql_alloc
{ {
bool window_names_are_checked;
public: public:
LEX_STRING *window_ref; LEX_STRING *window_ref;
...@@ -104,8 +106,9 @@ class Window_spec : public Sql_alloc ...@@ -104,8 +106,9 @@ class Window_spec : public Sql_alloc
SQL_I_List<ORDER> *part_list, SQL_I_List<ORDER> *part_list,
SQL_I_List<ORDER> *ord_list, SQL_I_List<ORDER> *ord_list,
Window_frame *win_frame) Window_frame *win_frame)
: window_ref(win_ref), partition_list(part_list), order_list(ord_list), : window_names_are_checked(false), window_ref(win_ref),
window_frame(win_frame), referenced_win_spec(NULL) {} partition_list(part_list), order_list(ord_list),
window_frame(win_frame), referenced_win_spec(NULL) {}
virtual char *name() { return NULL; } virtual char *name() { return NULL; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment