summaryrefslogtreecommitdiff
path: root/sql/item_windowfunc.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-02-05 16:00:39 +0100
committerSergei Golubchik <serg@mariadb.org>2018-02-06 14:51:31 +0100
commit2eb00d1ebac1898a26c7f2982923f088830967cc (patch)
treeeb2d82c3ff66a04b8d935c4901aaa0f471e0ca63 /sql/item_windowfunc.cc
parentc4930a820aeba156169b157971223bed81ea1876 (diff)
downloadmariadb-git-2eb00d1ebac1898a26c7f2982923f088830967cc.tar.gz
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
Diffstat (limited to 'sql/item_windowfunc.cc')
-rw-r--r--sql/item_windowfunc.cc5
1 files changed, 5 insertions, 0 deletions
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);
}