Commit 3f0def33 authored by unknown's avatar unknown

ndb - fix to Time comparison


ndb/src/common/util/NdbSqlUtil.cpp:
  remove stupid check
parent 0bc02450
...@@ -633,17 +633,8 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p ...@@ -633,17 +633,8 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p
return 0; return 0;
} }
#else #else
char t1[4], t2[4];
if (n1 == 3 && n2 == 3)
{
memcpy(t1, p1, 3);
memcpy(t2, p2, 3);
p1 = t1;
p2 = t2;
n1 = n2 = 4;
}
#ifdef ndb_date_sol9x86_cc_xO3_madness #ifdef ndb_date_sol9x86_cc_xO3_madness
if (n2 >= 4) { // may access 4-th byte if (n2 >= 3) {
const uchar* v1 = (const uchar*)p1; const uchar* v1 = (const uchar*)p1;
const uchar* v2 = (const uchar*)p2; const uchar* v2 = (const uchar*)p2;
// from Field_newdate::val_int // from Field_newdate::val_int
...@@ -658,7 +649,7 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p ...@@ -658,7 +649,7 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p
return 0; return 0;
} }
#else #else
if (n2 >= 4) { if (n2 >= 3) {
const uchar* v1 = (const uchar*)p1; const uchar* v1 = (const uchar*)p1;
const uchar* v2 = (const uchar*)p2; const uchar* v2 = (const uchar*)p2;
uint j1 = uint3korr(v1); uint j1 = uint3korr(v1);
...@@ -712,7 +703,7 @@ NdbSqlUtil::cmpText(const void* info, const void* p1, unsigned n1, const void* p ...@@ -712,7 +703,7 @@ NdbSqlUtil::cmpText(const void* info, const void* p1, unsigned n1, const void* p
int int
NdbSqlUtil::cmpTime(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full) NdbSqlUtil::cmpTime(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full)
{ {
if (n2 >= 4) { // may access 4-th byte if (n2 >= 3) {
const uchar* v1 = (const uchar*)p1; const uchar* v1 = (const uchar*)p1;
const uchar* v2 = (const uchar*)p2; const uchar* v2 = (const uchar*)p2;
// from Field_time::val_int // from Field_time::val_int
......
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