1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Use signed int64_t for comparing two TIME values in the order by clause.

This commit is contained in:
Gagan Goel
2019-12-06 14:31:48 +00:00
parent 06cbb1267f
commit ba4053bf2b

View File

@ -455,15 +455,19 @@ int TimeCompare::operator()(IdbCompare* l, Row::Pointer r1, Row::Pointer r2)
l->row1().setData(r1);
l->row2().setData(r2);
int ret = 0;
uint64_t v1 = l->row1().getUintField(fSpec.fIndex);
uint64_t v2 = l->row2().getUintField(fSpec.fIndex);
int64_t v1 = l->row1().getIntField(fSpec.fIndex);
int64_t v2 = l->row2().getIntField(fSpec.fIndex);
if (v1 == joblist::TIMENULL || v2 == joblist::TIMENULL)
bool b1 = (joblist::TIMENULL == (uint64_t) v1);
bool b2 = (joblist::TIMENULL == (uint64_t) v2);
int ret = 0;
if (b1 == true || b2 == true)
{
if (v1 != joblist::TIMENULL && v2 == joblist::TIMENULL)
if (b1 == false && b2 == true)
ret = fSpec.fNf;
else if (v1 == joblist::TIMENULL && v2 != joblist::TIMENULL)
else if (b1 == true && b2 == false)
ret = -fSpec.fNf;
}
else