Commit 7e57e82a authored by pekka@mysql.com's avatar pekka@mysql.com

Merge mysql.com:/export/space/pekka/ndb/version/my41

into mysql.com:/export/space/pekka/ndb/version/my50
parents 825d35b2 bcf1cb0f
...@@ -271,12 +271,24 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) ...@@ -271,12 +271,24 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)
break; break;
case NdbDictionary::Column::Date: case NdbDictionary::Column::Date:
{ {
uint tmp=uint3korr(r.aRef()); uint32 tmp=(uint32) uint3korr(r.aRef());
int year=(int) ((uint32) tmp/10000L % 10000); int part;
int month=(int) ((uint32) tmp/100 % 100);
int day=(int) ((uint32) tmp % 100);
char buf[40]; char buf[40];
sprintf(buf, "%04d-%02d-%02d", year, month, day); char *pos=(char*) buf+10;
*pos--=0;
part=(int) (tmp & 31);
*pos--= (char) ('0'+part%10);
*pos--= (char) ('0'+part/10);
*pos--= '-';
part=(int) (tmp >> 5 & 15);
*pos--= (char) ('0'+part%10);
*pos--= (char) ('0'+part/10);
*pos--= '-';
part=(int) (tmp >> 9);
*pos--= (char) ('0'+part%10); part/=10;
*pos--= (char) ('0'+part%10); part/=10;
*pos--= (char) ('0'+part%10); part/=10;
*pos= (char) ('0'+part);
out << buf; out << buf;
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment