Skip to content

Commit 2eb00d1

Browse files
committed
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
1 parent c4930a8 commit 2eb00d1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sql/item_windowfunc.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,5 +440,10 @@ void Item_window_func::print(String *str, enum_query_type query_type)
440440
{
441441
window_func()->print(str, query_type);
442442
str->append(" over ");
443+
#ifndef DBUG_OFF
444+
if (!window_spec) // one can call dbug_print_item() anytime in gdb
445+
str->append(window_name);
446+
else
447+
#endif
443448
window_spec->print(str, query_type);
444449
}

0 commit comments

Comments
 (0)