From 028992ac694eaef99653f3efe0f74ace22828261 Mon Sep 17 00:00:00 2001 From: "mhansson/martin@linux-st28.site" <> Date: Thu, 4 Oct 2007 09:15:26 +0200 Subject: Bug #30942: select str_to_date from derived table returns varying results The function str_to_date has a field to say whether it's invoked constant arguments. But this member was not initialized, causing the function to think that it could use a cache of the format type when said cache was in fact not initialized. Fixed by initializing the field to false. --- sql/item_timefunc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/item_timefunc.h') diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 8e925a0156f..cb69bd200e6 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -1030,7 +1030,7 @@ class Item_func_str_to_date :public Item_str_func bool const_item; public: Item_func_str_to_date(Item *a, Item *b) - :Item_str_func(a, b) + :Item_str_func(a, b), const_item(false) {} String *val_str(String *str); bool get_date(MYSQL_TIME *ltime, uint fuzzy_date); -- cgit v1.2.1 From 148ce22add54b3ab10bb568bb47078f01167973a Mon Sep 17 00:00:00 2001 From: "mhansson/martin@linux-st28.site" <> 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(). --- 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