提交 6b2bf42f 编写于 作者: G Ganlin Zhao

fix(query): twa function output NULL if input has overlap timestamps

TD-18224
上级 0d7e1eb4
...@@ -577,6 +577,7 @@ int32_t* taosGetErrno(); ...@@ -577,6 +577,7 @@ int32_t* taosGetErrno();
#define TSDB_CODE_FUNC_FUNTION_PARA_TYPE TAOS_DEF_ERROR_CODE(0, 0x2802) #define TSDB_CODE_FUNC_FUNTION_PARA_TYPE TAOS_DEF_ERROR_CODE(0, 0x2802)
#define TSDB_CODE_FUNC_FUNTION_PARA_VALUE TAOS_DEF_ERROR_CODE(0, 0x2803) #define TSDB_CODE_FUNC_FUNTION_PARA_VALUE TAOS_DEF_ERROR_CODE(0, 0x2803)
#define TSDB_CODE_FUNC_NOT_BUILTIN_FUNTION TAOS_DEF_ERROR_CODE(0, 0x2804) #define TSDB_CODE_FUNC_NOT_BUILTIN_FUNTION TAOS_DEF_ERROR_CODE(0, 0x2804)
#define TSDB_CODE_FUNC_DUP_TIMESTAMP TAOS_DEF_ERROR_CODE(0, 0x012B)
//udf //udf
#define TSDB_CODE_UDF_STOPPING TAOS_DEF_ERROR_CODE(0, 0x2901) #define TSDB_CODE_UDF_STOPPING TAOS_DEF_ERROR_CODE(0, 0x2901)
......
...@@ -5447,8 +5447,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { ...@@ -5447,8 +5447,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
numOfElems++; numOfElems++;
if (pInfo->p.key == st.key) { if (pInfo->p.key == st.key) {
numOfElems = 0; return TSDB_CODE_FUNC_DUP_TIMESTAMP;
goto _twa_over;
} }
INIT_INTP_POINT(st, tsList[i], val[i]); INIT_INTP_POINT(st, tsList[i], val[i]);
...@@ -5467,8 +5466,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { ...@@ -5467,8 +5466,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
numOfElems++; numOfElems++;
if (pInfo->p.key == st.key) { if (pInfo->p.key == st.key) {
numOfElems = 0; return TSDB_CODE_FUNC_DUP_TIMESTAMP;
goto _twa_over;
} }
INIT_INTP_POINT(st, tsList[i], val[i]); INIT_INTP_POINT(st, tsList[i], val[i]);
...@@ -5486,8 +5484,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { ...@@ -5486,8 +5484,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
numOfElems++; numOfElems++;
if (pInfo->p.key == st.key) { if (pInfo->p.key == st.key) {
numOfElems = 0; return TSDB_CODE_FUNC_DUP_TIMESTAMP;
goto _twa_over;
} }
INIT_INTP_POINT(st, tsList[i], val[i]); INIT_INTP_POINT(st, tsList[i], val[i]);
...@@ -5505,8 +5502,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { ...@@ -5505,8 +5502,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
numOfElems++; numOfElems++;
if (pInfo->p.key == st.key) { if (pInfo->p.key == st.key) {
numOfElems = 0; return TSDB_CODE_FUNC_DUP_TIMESTAMP;
goto _twa_over;
} }
INIT_INTP_POINT(st, tsList[i], val[i]); INIT_INTP_POINT(st, tsList[i], val[i]);
...@@ -5524,8 +5520,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { ...@@ -5524,8 +5520,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
numOfElems++; numOfElems++;
if (pInfo->p.key == st.key) { if (pInfo->p.key == st.key) {
numOfElems = 0; return TSDB_CODE_FUNC_DUP_TIMESTAMP;
goto _twa_over;
} }
INIT_INTP_POINT(st, tsList[i], val[i]); INIT_INTP_POINT(st, tsList[i], val[i]);
...@@ -5543,8 +5538,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { ...@@ -5543,8 +5538,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
numOfElems++; numOfElems++;
if (pInfo->p.key == st.key) { if (pInfo->p.key == st.key) {
numOfElems = 0; return TSDB_CODE_FUNC_DUP_TIMESTAMP;
goto _twa_over;
} }
INIT_INTP_POINT(st, tsList[i], val[i]); INIT_INTP_POINT(st, tsList[i], val[i]);
...@@ -5562,8 +5556,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { ...@@ -5562,8 +5556,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
numOfElems++; numOfElems++;
if (pInfo->p.key == st.key) { if (pInfo->p.key == st.key) {
numOfElems = 0; return TSDB_CODE_FUNC_DUP_TIMESTAMP;
goto _twa_over;
} }
INIT_INTP_POINT(st, tsList[i], val[i]); INIT_INTP_POINT(st, tsList[i], val[i]);
...@@ -5581,8 +5574,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { ...@@ -5581,8 +5574,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
numOfElems++; numOfElems++;
if (pInfo->p.key == st.key) { if (pInfo->p.key == st.key) {
numOfElems = 0; return TSDB_CODE_FUNC_DUP_TIMESTAMP;
goto _twa_over;
} }
INIT_INTP_POINT(st, tsList[i], val[i]); INIT_INTP_POINT(st, tsList[i], val[i]);
...@@ -5600,8 +5592,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { ...@@ -5600,8 +5592,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
numOfElems++; numOfElems++;
if (pInfo->p.key == st.key) { if (pInfo->p.key == st.key) {
numOfElems = 0; return TSDB_CODE_FUNC_DUP_TIMESTAMP;
goto _twa_over;
} }
INIT_INTP_POINT(st, tsList[i], val[i]); INIT_INTP_POINT(st, tsList[i], val[i]);
...@@ -5619,8 +5610,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { ...@@ -5619,8 +5610,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
numOfElems++; numOfElems++;
if (pInfo->p.key == st.key) { if (pInfo->p.key == st.key) {
numOfElems = 0; return TSDB_CODE_FUNC_DUP_TIMESTAMP;
goto _twa_over;
} }
INIT_INTP_POINT(st, tsList[i], val[i]); INIT_INTP_POINT(st, tsList[i], val[i]);
......
...@@ -579,6 +579,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_FUNTION_PARA_NUM, "Invalid function par ...@@ -579,6 +579,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_FUNTION_PARA_NUM, "Invalid function par
TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_FUNTION_PARA_TYPE, "Invalid function para type") TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_FUNTION_PARA_TYPE, "Invalid function para type")
TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_FUNTION_PARA_VALUE, "Invalid function para value") TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_FUNTION_PARA_VALUE, "Invalid function para value")
TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_NOT_BUILTIN_FUNTION, "Not buildin function") TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_NOT_BUILTIN_FUNTION, "Not buildin function")
TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_DUP_TIMESTAMP, "Duplicate timestamps not allowed in function")
//udf //udf
TAOS_DEFINE_ERROR(TSDB_CODE_UDF_STOPPING, "udf is stopping") TAOS_DEFINE_ERROR(TSDB_CODE_UDF_STOPPING, "udf is stopping")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册