summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-06-09 17:23:39 +0200
committerSergei Golubchik <sergii@pisem.net>2011-06-09 17:23:39 +0200
commitc3f665dc66d7ddb068875be9e78eb9b7a0d250e6 (patch)
tree409ebafb1a45415e89137c3066110afaa94420ae /sql/field.cc
parent9b98cae4cc44fa39813675b361b7aa65d129b29d (diff)
downloadmariadb-git-c3f665dc66d7ddb068875be9e78eb9b7a0d250e6.tar.gz
bugfixes:
microsecond(TIME) alter table datetime<->datetime(6) max(TIME), mix(TIME) mysql-test/t/func_if.test: fix the test case of avoid overflow sql/field.cc: don't use make_date() and make_time() sql/field.h: correct eq_def() for temporal fields sql/item.cc: move datetime caching from Item_cache_int to Item_cache_temporal sql/item.h: move datetime caching from Item_cache_int to Item_cache_temporal sql/item_func.cc: use existing helper methods, don't duplicate sql/item_sum.cc: argument cache must use argument's cmp_type, not result_type. sql/item_timefunc.cc: use existing methods, don't tuplicate. remove unused function. fix micorseconds() to support TIME argument sql/mysql_priv.h: dead code sql/time.cc: dead code
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 471072d2595..884c424aaf7 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -5289,7 +5289,13 @@ String *Field_time::val_str(String *val_buffer,
ltime.minute= (uint) (tmp/100 % 100);
ltime.second= (uint) (tmp % 100);
ltime.second_part= 0;
- make_time((DATE_TIME_FORMAT*) 0, &ltime, val_buffer);
+
+ val_buffer->alloc(MAX_DATE_STRING_REP_LENGTH);
+ uint length= (uint) my_time_to_str(&ltime,
+ const_cast<char*>(val_buffer->ptr()), 0);
+ val_buffer->length(length);
+ val_buffer->set_charset(&my_charset_bin);
+
return val_buffer;
}
@@ -5664,7 +5670,13 @@ String *Field_date::val_str(String *val_buffer,
ltime.year= (int) ((uint32) tmp/10000L % 10000);
ltime.month= (int) ((uint32) tmp/100 % 100);
ltime.day= (int) ((uint32) tmp % 100);
- make_date((DATE_TIME_FORMAT *) 0, &ltime, val_buffer);
+
+ val_buffer->alloc(MAX_DATE_STRING_REP_LENGTH);
+ uint length= (uint) my_date_to_str(&ltime,
+ const_cast<char*>(val_buffer->ptr()));
+ val_buffer->length(length);
+ val_buffer->set_charset(&my_charset_bin);
+
return val_buffer;
}