summaryrefslogtreecommitdiff
path: root/storage/connect/value.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2014-11-23 16:12:26 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2014-11-23 16:12:26 +0100
commit6211708a95a64728350ad8d0d3cc374388d49307 (patch)
tree1e72ad20142a186c50e8452565229bb7c06e2c8e /storage/connect/value.cpp
parentb2db891c1971a933104471b72877c90dd71aca53 (diff)
downloadmariadb-git-6211708a95a64728350ad8d0d3cc374388d49307.tar.gz
- Fix a bug causing the day always printed as Sunday for date columns with
a date format specifying DDD or DDDD. modified: storage/connect/ha_connect.cc storage/connect/value.cpp
Diffstat (limited to 'storage/connect/value.cpp')
-rw-r--r--storage/connect/value.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp
index 81d00862703..11793a7b141 100644
--- a/storage/connect/value.cpp
+++ b/storage/connect/value.cpp
@@ -2484,8 +2484,10 @@ char *DTVAL::GetCharString(char *p)
size_t n = 0;
struct tm tm, *ptm= GetGmTime(&tm);
- if (ptm)
+ if (ptm) {
+ mktime(ptm); // Populate tm_wday and tm_yday to get day name
n = strftime(Sdate, Len + 1, Pdtp->OutFmt, ptm);
+ } // endif ptm
if (!n) {
*Sdate = '\0';
@@ -2511,6 +2513,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;
@@ -2520,8 +2524,10 @@ char *DTVAL::ShowValue(char *buf, int len)
m = Len + 1;
} // endif Len
- if (ptm)
+ if (ptm) {
+ mktime(ptm); // Populate tm_wday and tm_yday to get day name
n = strftime(p, m, Pdtp->OutFmt, ptm);
+ } // endif ptm
if (!n) {
*p = '\0';