summaryrefslogtreecommitdiff
path: root/mysql-test/t/cache_temporal_4265.test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-03-13 22:33:52 +0100
committerSergei Golubchik <sergii@pisem.net>2013-03-13 22:33:52 +0100
commit372bc22bfaacd5c6959b99729a68e2d2a3b923a4 (patch)
treea7b6962b5af81e99e35a2daf72148d93cab0c415 /mysql-test/t/cache_temporal_4265.test
parentd24c8d9af104219bf2e42b89a585c4ba5c6facfa (diff)
downloadmariadb-git-372bc22bfaacd5c6959b99729a68e2d2a3b923a4.tar.gz
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.
Diffstat (limited to 'mysql-test/t/cache_temporal_4265.test')
-rw-r--r--mysql-test/t/cache_temporal_4265.test11
1 files changed, 11 insertions, 0 deletions
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;
+