diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-12-16 13:02:21 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-12-16 13:02:21 +0100 |
commit | d28d3ba40dc8ebef87199a2567ec96e9c5d744e2 (patch) | |
tree | c6b9ab1d8193fa2a26c5e376d43e536abd3a47ce /sql/item_timefunc.cc | |
parent | ff485d2dc4d5adaf5eef0ccd03ce62adf3bd30b3 (diff) | |
parent | 6bf10fac445d73fb796d4863612c87bff5f28b66 (diff) | |
download | mariadb-git-d28d3ba40dc8ebef87199a2567ec96e9c5d744e2.tar.gz |
10.0-base merge
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 6eaeec0804f..6ffa8b2af46 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1480,27 +1480,6 @@ String *Item_temporal_func::val_str(String *str) } -longlong Item_temporal_func::val_int() -{ - DBUG_ASSERT(fixed == 1); - MYSQL_TIME ltime; - if (get_date(<ime, sql_mode)) - return 0; - longlong v= TIME_to_ulonglong(<ime); - return ltime.neg ? -v : v; -} - - -double Item_temporal_func::val_real() -{ - DBUG_ASSERT(fixed == 1); - MYSQL_TIME ltime; - if (get_date(<ime, sql_mode)) - return 0; - return TIME_to_double(<ime); -} - - String *Item_temporal_hybrid_func::val_str_ascii(String *str) { DBUG_ASSERT(fixed == 1); @@ -2185,6 +2164,10 @@ longlong Item_extract::val_int() return 0; neg= ltime.neg ? -1 : 1; + DBUG_ASSERT(ltime.time_type != MYSQL_TIMESTAMP_TIME || ltime.day == 0); + if (ltime.time_type == MYSQL_TIMESTAMP_TIME) + time_to_daytime_interval(<ime); + switch (int_type) { case INTERVAL_YEAR: return ltime.year; case INTERVAL_YEAR_MONTH: return ltime.year*100L+ltime.month; |