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 /sql/sql_time.cc | |
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 'sql/sql_time.cc')
-rw-r--r-- | sql/sql_time.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_time.cc b/sql/sql_time.cc index 57dbd979933..dadf579b2e7 100644 --- a/sql/sql_time.cc +++ b/sql/sql_time.cc @@ -302,6 +302,9 @@ str_to_datetime_with_warn(CHARSET_INFO *cs, make_truncated_value_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, str, length, flags & TIME_TIME_ONLY ? MYSQL_TIMESTAMP_TIME : ts_type, NullS); + DBUG_EXECUTE_IF("str_to_datetime_warn", + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, + ER_YES, str);); return ts_type; } |