diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index c684d69d13508fd0fed3185c5b2fad308f616201..554f78f2d7b275775d2d0649b350eaa3485bf238 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -2725,7 +2725,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col memset(pExpr->aliasName, 0, tListLen(pExpr->aliasName)); getColumnName(pItem, pExpr->aliasName, sizeof(pExpr->aliasName) - 1); - SColumnList ids = getColumnList(1, 0, index.columnIndex); + SColumnList ids = getColumnList(1, index.tableIndex, index.columnIndex); if (finalResult) { insertResultField(pQueryInfo, colIndex, &ids, pUdfInfo->resBytes, pUdfInfo->resType, pExpr->aliasName, pExpr); } else { diff --git a/tests/script/sh/demo.c b/tests/script/sh/demo.c index af2008ccef8c0436ca8bd6b8ec9b1ac54e2e163b..a506014a9e1679fb1eba038d707faa335c91483b 100644 --- a/tests/script/sh/demo.c +++ b/tests/script/sh/demo.c @@ -21,6 +21,7 @@ void demo(char* data, short itype, short ibytes, int numOfRows, long long* ts, c int i; double r = 0; SDemo *p = (SDemo *)interBuf; + SDemo *q = (SDemo *)dataOutput; printf("demo input data:%p, type:%d, rows:%d, ts:%p,%lld, dataoutput:%p, interBUf:%p, tsOutput:%p, numOfOutput:%p, buf:%p\n", data, itype, numOfRows, ts, *ts, dataOutput, interBuf, tsOutput, numOfOutput, buf); for(i=0;iotype = otype; p->num += numOfRows; + q->sum = p->sum; + q->num = p->num; + q->otype = p->otype; + *numOfOutput=1; printf("demo out, sum:%f, num:%d, numOfOutput:%d\n", p->sum, p->num, *numOfOutput);