Merge pull request #20739 from taosdata/fix/TS-3063
fix(query): fix interp tsdbReader external range not setting properly
This commit is contained in:
commit
ec3c706c3b
|
@ -4246,10 +4246,6 @@ static void freeSchemaFunc(void* param) {
|
||||||
int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableList, int32_t numOfTables,
|
int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableList, int32_t numOfTables,
|
||||||
SSDataBlock* pResBlock, STsdbReader** ppReader, const char* idstr, bool countOnly) {
|
SSDataBlock* pResBlock, STsdbReader** ppReader, const char* idstr, bool countOnly) {
|
||||||
STimeWindow window = pCond->twindows;
|
STimeWindow window = pCond->twindows;
|
||||||
if (pCond->type == TIMEWINDOW_RANGE_EXTERNAL) {
|
|
||||||
pCond->twindows.skey += 1;
|
|
||||||
pCond->twindows.ekey -= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t capacity = pVnode->config.tsdbCfg.maxRows;
|
int32_t capacity = pVnode->config.tsdbCfg.maxRows;
|
||||||
if (pResBlock != NULL) {
|
if (pResBlock != NULL) {
|
||||||
|
@ -4272,11 +4268,11 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL
|
||||||
// update the SQueryTableDataCond to create inner reader
|
// update the SQueryTableDataCond to create inner reader
|
||||||
int32_t order = pCond->order;
|
int32_t order = pCond->order;
|
||||||
if (order == TSDB_ORDER_ASC) {
|
if (order == TSDB_ORDER_ASC) {
|
||||||
pCond->twindows.ekey = window.skey;
|
pCond->twindows.ekey = window.skey - 1;
|
||||||
pCond->twindows.skey = INT64_MIN;
|
pCond->twindows.skey = INT64_MIN;
|
||||||
pCond->order = TSDB_ORDER_DESC;
|
pCond->order = TSDB_ORDER_DESC;
|
||||||
} else {
|
} else {
|
||||||
pCond->twindows.skey = window.ekey;
|
pCond->twindows.skey = window.ekey + 1;
|
||||||
pCond->twindows.ekey = INT64_MAX;
|
pCond->twindows.ekey = INT64_MAX;
|
||||||
pCond->order = TSDB_ORDER_ASC;
|
pCond->order = TSDB_ORDER_ASC;
|
||||||
}
|
}
|
||||||
|
@ -4288,11 +4284,11 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL
|
||||||
}
|
}
|
||||||
|
|
||||||
if (order == TSDB_ORDER_ASC) {
|
if (order == TSDB_ORDER_ASC) {
|
||||||
pCond->twindows.skey = window.ekey;
|
pCond->twindows.skey = window.ekey + 1;
|
||||||
pCond->twindows.ekey = INT64_MAX;
|
pCond->twindows.ekey = INT64_MAX;
|
||||||
} else {
|
} else {
|
||||||
pCond->twindows.skey = INT64_MIN;
|
pCond->twindows.skey = INT64_MIN;
|
||||||
pCond->twindows.ekey = window.ekey;
|
pCond->twindows.ekey = window.ekey - 1;
|
||||||
}
|
}
|
||||||
pCond->order = order;
|
pCond->order = order;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue