summaryrefslogtreecommitdiff
path: root/storage/connect/value.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2014-11-24 20:15:03 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2014-11-24 20:15:03 +0100
commit75c461d569d651e6736e5f0e8de1c85a0e485854 (patch)
tree1b969f3b76ea04666d7bad1990842f8755f12460 /storage/connect/value.cpp
parentd592f665780337065827881e886a4230adac0a42 (diff)
parentc3b0894f7d25a397aa7ec9af9c9afcbe129ae4fa (diff)
downloadmariadb-git-75c461d569d651e6736e5f0e8de1c85a0e485854.tar.gz
- Move mktime in TIME_to_localtime because on Linux the hour can be modified
modified: storage/connect/value.cpp - These files were commited even not modified (?) modified: storage/connect/ha_connect.cc storage/connect/odbconn.cpp storage/connect/odbconn.h storage/connect/tabodbc.cpp
Diffstat (limited to 'storage/connect/value.cpp')
-rw-r--r--storage/connect/value.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp
index 81d00862703..7227e637a14 100644
--- a/storage/connect/value.cpp
+++ b/storage/connect/value.cpp
@@ -2187,10 +2187,11 @@ static void TIME_to_localtime(struct tm *tm, const MYSQL_TIME *ltime)
tm->tm_year= ltime->year - 1900;
tm->tm_mon= ltime->month - 1;
tm->tm_mday= ltime->day;
+ mktime(tm); // set tm->tm_wday tm->yday fields to get proper day name (OB)
tm->tm_hour= ltime->hour;
tm->tm_min= ltime->minute;
tm->tm_sec= ltime->second;
-}
+} // end of TIME_to_localtime
// Added by Alexander Barkov
static struct tm *gmtime_mysql(const time_t *timep, struct tm *tm)
@@ -2199,7 +2200,7 @@ static struct tm *gmtime_mysql(const time_t *timep, struct tm *tm)
thd_gmt_sec_to_TIME(current_thd, &ltime, (my_time_t) *timep);
TIME_to_localtime(tm, &ltime);
return tm;
-}
+} // end of gmtime_mysql
/***********************************************************************/
/* GetGmTime: returns a pointer to a static tm structure obtained */
@@ -2511,6 +2512,8 @@ char *DTVAL::ShowValue(char *buf, int len)
if (!Null) {
size_t m, n = 0;
struct tm tm, *ptm = GetGmTime(&tm);
+
+
if (Len < len) {
p = buf;
@@ -2596,7 +2599,7 @@ bool DTVAL::WeekNum(PGLOBAL g, int& nval)
/***********************************************************************/
bool DTVAL::FormatValue(PVAL vp, char *fmt)
{
- char *buf = (char*)vp->GetTo_Val(); // Should be big enough
+ char *buf = (char*)vp->GetTo_Val(); // Should be big enough
struct tm tm, *ptm = GetGmTime(&tm);
if (trace > 1)