diff options
author | unknown <tomas@poseidon.mysql.com> | 2007-03-08 00:27:54 +0700 |
---|---|---|
committer | unknown <tomas@poseidon.mysql.com> | 2007-03-08 00:27:54 +0700 |
commit | 9031937983c3cd598a1a39a00c5a60a6745d0ebd (patch) | |
tree | 8c6259e6838693ed982e1820c005cfb9f3317002 /storage | |
parent | 81bf8ef1ffb1bf97f5c6d509e89b326133dcfab5 (diff) | |
parent | 6928f535325fe81d6bda70b5320b91c56d2e2064 (diff) | |
download | mariadb-git-9031937983c3cd598a1a39a00c5a60a6745d0ebd.tar.gz |
Merge poseidon.mysql.com:/home/tomas/mysql-5.0-telco-gca-ndb_restore
into poseidon.mysql.com:/home/tomas/mysql-5.1-telco-gca-ndb_restore
storage/ndb/src/ndbapi/NdbRecAttr.cpp:
Auto merged
Diffstat (limited to 'storage')
-rw-r--r-- | storage/ndb/src/ndbapi/NdbRecAttr.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/storage/ndb/src/ndbapi/NdbRecAttr.cpp b/storage/ndb/src/ndbapi/NdbRecAttr.cpp index 4d2a018f863..cec61028541 100644 --- a/storage/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/storage/ndb/src/ndbapi/NdbRecAttr.cpp @@ -233,17 +233,26 @@ ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r, out << r.u_64_value(); break; case NdbDictionary::Column::Bit: - for (j = (length-1)/32 + 1; j > 0; j--) - if (*((Uint32*)r.aRef() + j - 1)) - break; - if (j == 0) + out << f.hex_prefix << "0x"; + if (length < 33) { - out << "0x0"; - break; + out.print("%X", r.u_32_value()); + } + else if (length < 65) + { + out.print("%llX", r.u_64_value()); + } + else + { + const unsigned char *buf = (unsigned char *)r.aRef(); + int k = 4*((length+31)/32); + while (k > 0 && (*(buf + --k) == 0)); + do + { + out.print("%X", (Uint32)*(buf + k--)); + } + while (k >= 0); } - out << f.hex_prefix << "0x"; - for (; j > 0; j--) - out.print("%X", *((Uint32*)r.aRef() + j - 1)); break; case NdbDictionary::Column::Unsigned: if (length > 1) |