From ae4141ed75124cc4bbae5fa22662ef0e7f00b122 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Oct 2007 14:58:09 +0200 Subject: Bug#31160: MAKETIME() crashes server when returning NULL in ORDER BY using filesort Even though it returns NULL, the MAKETIME function did not have this property set, causing a failed assertion (designed to catch exactly this). Fixed by setting the nullability property of MAKETIME(). mysql-test/r/func_sapdb.result: Bug#31160: Changed test result. mysql-test/r/func_time.result: Bug#31160: Test result. mysql-test/t/func_time.test: Bug#31160: Test case. sql/item_timefunc.h: Bug#31160: The fix: Initializing maybe_null to true --- sql/item_timefunc.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sql/item_timefunc.h') diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 8e925a0156f..3e860017d89 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -962,7 +962,10 @@ class Item_func_maketime :public Item_str_timefunc { public: Item_func_maketime(Item *a, Item *b, Item *c) - :Item_str_timefunc(a, b ,c) {} + :Item_str_timefunc(a, b, c) + { + maybe_null= TRUE; + } String *val_str(String *str); const char *func_name() const { return "maketime"; } }; -- cgit v1.2.1