bugfixes:

microsecond(TIME)
  alter table datetime<->datetime(6)
  max(TIME), mix(TIME) 

mysql-test/t/func_if.test:
  fix the test case of avoid overflow
sql/field.cc:
  don't use make_date() and make_time()
sql/field.h:
  correct eq_def() for temporal fields
sql/item.cc:
  move datetime caching from Item_cache_int
  to Item_cache_temporal
sql/item.h:
  move datetime caching from Item_cache_int
  to Item_cache_temporal
sql/item_func.cc:
  use existing helper methods, don't duplicate
sql/item_sum.cc:
  argument cache must use argument's cmp_type, not result_type.
sql/item_timefunc.cc:
  use existing methods, don't tuplicate.
  remove unused function.
  fix micorseconds() to support TIME argument
sql/mysql_priv.h:
  dead code
sql/time.cc:
  dead code
This commit is contained in:
Sergei Golubchik 2011-06-09 17:23:39 +02:00
commit c3f665dc66
20 changed files with 158 additions and 144 deletions

View file

@ -880,11 +880,11 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
*/
Query_arena backup;
Query_arena *save_arena= thd->switch_to_arena_for_cached_items(&backup);
Item_cache_int *cache= new Item_cache_int(f_type);
Item_cache_temporal *cache= new Item_cache_temporal(f_type);
if (save_arena)
thd->set_query_arena(save_arena);
cache->store_longlong(item, value);
cache->store_packed(value);
*cache_arg= cache;
*item_arg= cache_arg;
}