MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:John David Duncan Date:March 8 2010 8:29pm
Subject:bzr commit into mysql-5.1-telco-6.3 branch (jdd:3132) Bug#44763
View as plain text  
#At file:///Users/jdd/Desktop/dev/bug44763/ based on revid:jdd@stripped

 3132 John David Duncan	2010-03-08
      bug#44763 : print Timestamp fields as YYYY-MM-DD/HH:MM:SS in local time zone,
      so that ``ndb_restore --print-data'' output can be loaded back into mysql.

    modified:
      storage/ndb/src/ndbapi/NdbRecAttr.cpp
=== modified file 'storage/ndb/src/ndbapi/NdbRecAttr.cpp'
--- a/storage/ndb/src/ndbapi/NdbRecAttr.cpp	2009-05-26 18:53:34 +0000
+++ b/storage/ndb/src/ndbapi/NdbRecAttr.cpp	2010-03-08 20:26:37 +0000
@@ -525,8 +525,20 @@ ndbrecattr_print_formatted(NdbOut& out, 
     break;
     case NdbDictionary::Column::Timestamp:
     {
-      time_t time = r.u_32_value();
-      out << (uint)time;
+      time_t time_result = r.u_32_value();
+      struct tm tm_result;
+      char asc_result[20];
+
+      localtime_r(&time_result, &tm_result);
+      sprintf(asc_result, "%4d-%02d-%02d/%02d:%02d:%02d", 
+	      tm_result.tm_year + 1900,
+	      tm_result.tm_mon + 1,
+	      tm_result.tm_mday,
+	      tm_result.tm_hour,
+	      tm_result.tm_min,
+	      tm_result.tm_sec);
+    
+      out << asc_result;
     }
     break;
     case NdbDictionary::Column::Blob:


Attachment: [text/bzr-bundle] bzr/jdd@sun.com-20100308202637-kaix9gw6f4witnn0.bundle
Thread
bzr commit into mysql-5.1-telco-6.3 branch (jdd:3132) Bug#44763John David Duncan8 Mar