summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authortsmith@ramayana.hindu.god <>2007-12-04 20:58:21 -0700
committertsmith@ramayana.hindu.god <>2007-12-04 20:58:21 -0700
commit10cab933b29583df5d9d4c490c6e602d35264385 (patch)
tree0314ad5cd173e9b49968cb56e0081e21eb2fdd5f /sql/item_timefunc.cc
parent0e78354baa5ed83f115b6f96e21b31fe0b1e4cbc (diff)
parent02e321d3502e8771f2092c6167de189423f4ec49 (diff)
downloadmariadb-git-10cab933b29583df5d9d4c490c6e602d35264385.tar.gz
Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0
into ramayana.hindu.god:/home/tsmith/m/bk/maint/50
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 3a2df5125ba..4ddc788b182 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1603,8 +1603,7 @@ bool Item_func_now::get_date(MYSQL_TIME *res,
int Item_func_now::save_in_field(Field *to, bool no_conversions)
{
to->set_notnull();
- to->store_time(&ltime, MYSQL_TIMESTAMP_DATETIME);
- return 0;
+ return to->store_time(&ltime, MYSQL_TIMESTAMP_DATETIME);
}
@@ -2646,6 +2645,13 @@ bool Item_date_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
}
+bool Item_date_typecast::get_time(MYSQL_TIME *ltime)
+{
+ bzero((char *)ltime, sizeof(MYSQL_TIME));
+ return args[0]->null_value;
+}
+
+
String *Item_date_typecast::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
@@ -3308,7 +3314,7 @@ void Item_func_str_to_date::fix_length_and_dec()
{
maybe_null= 1;
decimals=0;
- cached_field_type= MYSQL_TYPE_STRING;
+ cached_field_type= MYSQL_TYPE_DATETIME;
max_length= MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
cached_timestamp_type= MYSQL_TIMESTAMP_NONE;
if ((const_item= args[1]->const_item()))