1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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.
This commit is contained in:
Sergei Golubchik
2013-03-13 22:33:52 +01:00
parent d24c8d9af1
commit 372bc22bfa
6 changed files with 29 additions and 1 deletions

View File

@ -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;
}