summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorvenu@myvenu.com <>2003-01-03 03:54:18 -0800
committervenu@myvenu.com <>2003-01-03 03:54:18 -0800
commit881c9808a41cbeb00bb117029ca648dd42578a16 (patch)
treeaa23c12823529e52874402293e8bde3c932aed09 /sql/field.cc
parentc9000c247c057f9f5ae7ef40a34d1b973c00ab20 (diff)
parent5c4b7a2e9623b6a9ceb2294d9b8ddc5c4bdba762 (diff)
downloadmariadb-git-881c9808a41cbeb00bb117029ca648dd42578a16.tar.gz
Merge myvenu.com:/home/venu/bk/src-4.1
into myvenu.com:/home/venu/work/sql/dev-4.1
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc35
1 files changed, 32 insertions, 3 deletions
diff --git a/sql/field.cc b/sql/field.cc
index be565e2e869..1a0b5d496b2 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -2599,7 +2599,7 @@ String *Field_double::val_str(String *val_buffer,
bool Field_double::send_binary(Protocol *protocol)
{
- return protocol->store((float) Field_double::val_real(), dec, (String*) 0);
+ return protocol->store((double) Field_double::val_real(), dec, (String*) 0);
}
@@ -3169,7 +3169,7 @@ bool Field_time::send_binary(Protocol *protocol)
Field_time::get_time(&tm);
tm.day= tm.hour/3600; // Move hours to days
tm.hour-= tm.day*3600;
- return protocol->store(&tm);
+ return protocol->store_time(&tm);
}
@@ -3254,6 +3254,13 @@ int Field_year::store(longlong nr)
return 0;
}
+bool Field_year::send_binary(Protocol *protocol)
+{
+ ulonglong tmp= Field_year::val_int();
+ TIME tm;
+ tm.year= (uint32) tmp;
+ return protocol->store_date(&tm);
+}
double Field_year::val_real(void)
{
@@ -3371,6 +3378,16 @@ int Field_date::store(longlong nr)
return error;
}
+bool Field_date::send_binary(Protocol *protocol)
+{
+ longlong tmp= Field_date::val_int();
+ TIME tm;
+ tm.year= (uint32) tmp/10000L % 10000;
+ tm.month= (uint32) tmp/100 % 100;
+ tm.day= (uint32) tmp % 100;
+ return protocol->store_date(&tm);
+}
+
double Field_date::val_real(void)
{
@@ -3544,7 +3561,12 @@ void Field_newdate::store_time(TIME *ltime,timestamp_type type)
int3store(ptr,tmp);
}
-
+bool Field_newdate::send_binary(Protocol *protocol)
+{
+ TIME tm;
+ Field_newdate::get_date(&tm,0);
+ return protocol->store_date(&tm);
+}
double Field_newdate::val_real(void)
{
@@ -3705,6 +3727,13 @@ void Field_datetime::store_time(TIME *ltime,timestamp_type type)
longlongstore(ptr,tmp);
}
+bool Field_datetime::send_binary(Protocol *protocol)
+{
+ TIME tm;
+ Field_datetime::get_date(&tm, 1);
+ return protocol->store(&tm);
+}
+
double Field_datetime::val_real(void)
{