diff options
author | unknown <pekka@mysql.com> | 2005-02-04 10:35:09 +0100 |
---|---|---|
committer | unknown <pekka@mysql.com> | 2005-02-04 10:35:09 +0100 |
commit | dbf8329576ee7470757adb778a21a665049a2a63 (patch) | |
tree | 339f1a279a5d1c87828fcd5e0389ff813228edeb /ndb | |
parent | e33ef0d9ec29e5420ad9824b781fb68258246d84 (diff) | |
parent | 876b4a59b1e72c29061a8ff973d2baa39f2cc6d0 (diff) | |
download | mariadb-git-dbf8329576ee7470757adb778a21a665049a2a63.tar.gz |
Merge
BitKeeper/etc/logging_ok:
auto-union
sql/item_func.cc:
Auto merged
ndb/src/common/util/NdbSqlUtil.cpp:
merge
Diffstat (limited to 'ndb')
-rw-r--r-- | ndb/src/common/util/NdbSqlUtil.cpp | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp index d5f06f119ee..b691b4cb512 100644 --- a/ndb/src/common/util/NdbSqlUtil.cpp +++ b/ndb/src/common/util/NdbSqlUtil.cpp @@ -550,8 +550,6 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p return +1; return 0; } - assert(! full); - return CmpUnknown; #else char t1[4], t2[4]; if (n1 == 3 && n2 == 3) @@ -562,6 +560,7 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p p2 = t2; n1 = n2 = 4; } +#ifdef ndb_date_sol9x86_cc_xO3_madness if (n2 >= 4) { // may access 4-th byte const uchar* v1 = (const uchar*)p1; const uchar* v2 = (const uchar*)p2; @@ -576,9 +575,40 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p return +1; return 0; } +#else + if (n2 >= 4) { + const uchar* v1 = (const uchar*)p1; + const uchar* v2 = (const uchar*)p2; + uint j1 = uint3korr(v1); + uint j2 = uint3korr(v2); + uint d1 = (j1 & 31); + uint d2 = (j2 & 31); + j1 = (j1 >> 5); + j2 = (j2 >> 5); + uint m1 = (j1 & 15); + uint m2 = (j2 & 15); + j1 = (j1 >> 4); + j2 = (j2 >> 4); + uint y1 = j1; + uint y2 = j2; + if (y1 < y2) + return -1; + if (y1 > y2) + return +1; + if (m1 < m2) + return -1; + if (m1 > m2) + return +1; + if (d1 < d2) + return -1; + if (d1 > d2) + return +1; + return 0; + } +#endif +#endif assert(! full); return CmpUnknown; -#endif } // not supported |