From 2eb00d1ebac1898a26c7f2982923f088830967cc Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 5 Feb 2018 16:00:39 +0100 Subject: [PATCH] fix Item_window_func::print() not to crash before fix_fields() because dbug_print_item() can be invoked any time in gdb, also before fix_fields. this fixes a crash of main.win in debug builds --- sql/item_windowfunc.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sql/item_windowfunc.cc b/sql/item_windowfunc.cc index 27b007201c5..5fbfb2651af 100644 --- a/sql/item_windowfunc.cc +++ b/sql/item_windowfunc.cc @@ -440,5 +440,10 @@ void Item_window_func::print(String *str, enum_query_type query_type) { window_func()->print(str, query_type); str->append(" over "); +#ifndef DBUG_OFF + if (!window_spec) // one can call dbug_print_item() anytime in gdb + str->append(window_name); + else +#endif window_spec->print(str, query_type); }