From 372bc22bfaacd5c6959b99729a68e2d2a3b923a4 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 13 Mar 2013 22:33:52 +0100 Subject: MDEV-4265 5.5 is slower than 5.3 because of many str_to_datetime calls get_datetime_value() should not double-cache its own Item_cache_temporal items, but it *should* cache other Item_cache items, such as Item_cache_str. sql/item.h: shortcut, to avoid going through the switch in Item::cmp_type() sql/item_cmpfunc.cc: even if the item is Item_cache_str - it still needs to be converted and cached. sql/item_timefunc.h: all descendants of Item_temporal_func always have cmp_type==TIME_RESULT. Even Item_date_add_interval, that might have field_type == MYSQL_TYPE_STRING. --- sql/item.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/item.h') diff --git a/sql/item.h b/sql/item.h index bdf6fbe548e..901ebd3b6d8 100644 --- a/sql/item.h +++ b/sql/item.h @@ -4030,6 +4030,7 @@ public: bool cache_value(); bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); int save_in_field(Field *field, bool no_conversions); + Item_result cmp_type() const { return TIME_RESULT; } void store_packed(longlong val_arg, Item *example); /* Having a clone_item method tells optimizer that this object -- cgit v1.2.1