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. --- mysql-test/t/cache_temporal_4265.test | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 mysql-test/t/cache_temporal_4265.test (limited to 'mysql-test/t/cache_temporal_4265.test') diff --git a/mysql-test/t/cache_temporal_4265.test b/mysql-test/t/cache_temporal_4265.test new file mode 100644 index 00000000000..6135438f023 --- /dev/null +++ b/mysql-test/t/cache_temporal_4265.test @@ -0,0 +1,11 @@ +# +# MDEV-4265 5.5 is slower than 5.3 because of many str_to_datetime calls +# +--source include/have_debug.inc + +create table t1 (a date); +insert t1 values ('2000-01-02'), ('2001-02-03'), ('2002-03-04'); +set debug_dbug='d,str_to_datetime_warn'; +select * from t1 where a > date_add('2000-01-01', interval 5 day); +drop table t1; + -- cgit v1.2.1