opti:add case for double and float
This commit is contained in:
parent
b8725618f0
commit
fa9f273449
|
@ -5034,8 +5034,13 @@ int32_t fltSclBuildRangePoints(SFltSclOperator *oper, SArray *points) {
|
|||
SValueNode *valueNode = (SValueNode *)cell->pNode;
|
||||
SFltSclDatum valDatum;
|
||||
FLT_ERR_RET(fltSclBuildDatumFromValueNode(&valDatum, valueNode));
|
||||
if(valueNode->node.resType.type == TSDB_DATA_TYPE_FLOAT || valueNode->node.resType.type == TSDB_DATA_TYPE_DOUBLE) {
|
||||
minDatum.i = TMIN(minDatum.i, valDatum.d);
|
||||
maxDatum.i = TMAX(maxDatum.i, valDatum.d);
|
||||
} else {
|
||||
minDatum.i = TMIN(minDatum.i, valDatum.i);
|
||||
maxDatum.i = TMAX(maxDatum.i, valDatum.i);
|
||||
}
|
||||
cell = cell->pNext;
|
||||
}
|
||||
SFltSclPoint startPt = {.start = true, .excl = false, .val = minDatum};
|
||||
|
|
|
@ -95,4 +95,38 @@ endi
|
|||
if $data20 != @ Time Range: [1657441840000, 1657441980000]@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql explain verbose true select * from tb1 where fts in ('2022-07-10 16:31:00', '2022-07-10 16:33:00', 1657441840000, true);
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != @ Time Range: [0, 1657441980000]@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql explain verbose true select * from tb1 where fts in ('2022-07-10 16:31:00', '2022-07-10 16:33:00', 1657441840000, false);
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != @ Time Range: [1, 1657441980000]@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql explain verbose true select * from tb1 where fts in ('2022-07-10 16:31:00', '2022-07-10 16:33:00', 1657441840000, 1.02);
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != @ Time Range: [1, 1657441980000]@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql explain verbose true select * from tb1 where fts in ('2022-07-10 16:31:00', '2022-07-10 16:33:00', 1657441840000, -1.02);
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != @ Time Range: [-1, 1657441980000]@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql_error explain verbose true select * from tb1 where fts in ('2022-07-10 16:31:00', '2022-07-10 16:33:00', 1657441840000, 'abc');
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
Loading…
Reference in New Issue