summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2004-10-20 16:45:09 +0400
committerunknown <konstantin@mysql.com>2004-10-20 16:45:09 +0400
commit7c20b1328866061273617ec7e8ae7b4e00c8674c (patch)
treeb63f30c547d9c739a72eccdd5b8817f371e31a6d /sql/item.cc
parent6875cf36d1625449f539c9eaefb8171158231ee2 (diff)
parent8fe8912f4c1d01b9bb8c5c1aefe4ac6405a87976 (diff)
downloadmariadb-git-7c20b1328866061273617ec7e8ae7b4e00c8674c.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/kostja/work/mysql-4.1-6049 libmysql/libmysql.c: Auto merged sql/field.cc: Auto merged sql/item.cc: Auto merged sql/mysql_priv.h: Auto merged tests/client_test.c: Auto merged
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/sql/item.cc b/sql/item.cc
index b37d0aed1ae..58143f52aff 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -988,9 +988,10 @@ String *Item_param::val_str(String* str)
return str;
case TIME_VALUE:
{
- if (str->reserve(MAX_DATE_REP_LENGTH))
+ if (str->reserve(MAX_DATE_STRING_REP_LENGTH))
break;
- TIME_to_string(&value.time, str);
+ str->length((uint) my_TIME_to_str(&value.time, (char*) str->ptr()));
+ str->set_charset(&my_charset_bin);
return str;
}
case NULL_VALUE:
@@ -1020,24 +1021,19 @@ const String *Item_param::query_val_str(String* str) const
case TIME_VALUE:
{
char *buf, *ptr;
- String tmp;
str->length(0);
/*
TODO: in case of error we need to notify replication
that binary log contains wrong statement
*/
- if (str->reserve(MAX_DATE_REP_LENGTH+3))
+ if (str->reserve(MAX_DATE_STRING_REP_LENGTH+3))
break;
/* Create date string inplace */
buf= str->c_ptr_quick();
ptr= buf;
*ptr++= '\'';
- tmp.set(ptr, MAX_DATE_REP_LENGTH, &my_charset_bin);
- tmp.length(0);
- TIME_to_string(&value.time, &tmp);
-
- ptr+= tmp.length();
+ ptr+= (uint) my_TIME_to_str(&value.time, ptr);
*ptr++= '\'';
str->length((uint32) (ptr - buf));
break;