提交 9fa47f7e 编写于 作者: G Ganlin Zhao

fix(query): twa function handling null constant or all null column

TD-17562
上级 26c6db23
...@@ -5210,6 +5210,11 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { ...@@ -5210,6 +5210,11 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
SPoint1* last = &pInfo->p; SPoint1* last = &pInfo->p;
int32_t numOfElems = 0; int32_t numOfElems = 0;
if (IS_NULL_TYPE(pInputCol->info.type)) {
pInfo->isNull = true;
goto _twa_over;
}
int32_t i = pInput->startRowIndex; int32_t i = pInput->startRowIndex;
if (pCtx->start.key != INT64_MIN) { if (pCtx->start.key != INT64_MIN) {
ASSERT((pCtx->start.key < tsList[i] && pCtx->order == TSDB_ORDER_ASC) || ASSERT((pCtx->start.key < tsList[i] && pCtx->order == TSDB_ORDER_ASC) ||
...@@ -5393,10 +5398,6 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { ...@@ -5393,10 +5398,6 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
} }
break; break;
} }
case TSDB_DATA_TYPE_NULL: {
pInfo->isNull = true;
break;
}
default: default:
ASSERT(0); ASSERT(0);
...@@ -5410,6 +5411,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { ...@@ -5410,6 +5411,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
pInfo->win.ekey = pInfo->p.key; pInfo->win.ekey = pInfo->p.key;
_twa_over:
if (numOfElems == 0) { if (numOfElems == 0) {
pInfo->isNull = true; pInfo->isNull = true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册