summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorhf@deer.mysql.r18.ru <>2003-01-28 12:59:07 +0400
committerhf@deer.mysql.r18.ru <>2003-01-28 12:59:07 +0400
commit6bca9b7034d736e1aa78ed4b3204d26b712d1623 (patch)
tree91ecc381255a1f6b27acaad85c16ac20d6be0d0f /sql/item.cc
parent524e33eb5916a10ff363959f589fdd388ee7a5a7 (diff)
parent6fea54dd8ddb6ee0cd74a30ca6a503ec3919d073 (diff)
downloadmariadb-git-6bca9b7034d736e1aa78ed4b3204d26b712d1623.tar.gz
Merge abotchkov@work.mysql.com:/home/bk/mysql-4.1
into deer.mysql.r18.ru:/home/hf/work/mysql-default
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc
index f1fee7e8ef1..575c5b4d89c 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -347,6 +347,25 @@ void Item_param::set_value(const char *str, uint length)
}
+void Item_param::set_time(TIME *tm, timestamp_type type)
+{
+ ltime.year= tm->year;
+ ltime.month= tm->month;
+ ltime.day= tm->day;
+
+ ltime.hour= tm->hour;
+ ltime.minute= tm->minute;
+ ltime.second= tm->second;
+
+ ltime.second_part= tm->second_part;
+
+ ltime.time_type= type;
+
+ item_is_time= true;
+ item_type= STRING_ITEM;
+}
+
+
void Item_param::set_longdata(const char *str, ulong length)
{
str_value.append(str,length);
@@ -369,11 +388,21 @@ int Item_param::save_in_field(Field *field, bool no_conversions)
{
double nr=val();
return (field->store(nr)) ? -1 : 0;
+ }
+ if (item_is_time)
+ {
+ field->store_time(&ltime, ltime.time_type);
+ return 0;
}
String *result=val_str(&str_value);
return (field->store(result->ptr(),result->length(),field->charset())) ? -1 : 0;
}
+bool Item_param::get_time(TIME *res)
+{
+ *res=ltime;
+ return 0;
+}
double Item_param::val()
{