diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-03-13 22:33:52 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-03-13 22:33:52 +0100 |
commit | 372bc22bfaacd5c6959b99729a68e2d2a3b923a4 (patch) | |
tree | a7b6962b5af81e99e35a2daf72148d93cab0c415 /mysql-test | |
parent | d24c8d9af104219bf2e42b89a585c4ba5c6facfa (diff) | |
download | mariadb-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')
-rw-r--r-- | mysql-test/r/cache_temporal_4265.result | 11 | ||||
-rw-r--r-- | mysql-test/t/cache_temporal_4265.test | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/r/cache_temporal_4265.result b/mysql-test/r/cache_temporal_4265.result new file mode 100644 index 00000000000..b8f13e465de --- /dev/null +++ b/mysql-test/r/cache_temporal_4265.result @@ -0,0 +1,11 @@ +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); +a +2001-02-03 +2002-03-04 +Warnings: +Note 1003 2000-01-01 +Note 1003 2000-01-06 +drop table t1; 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; + |