From 3e9773d451b52c054f84cbb630cda0ac71b29203 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Mon, 26 Apr 2021 18:40:29 +0800 Subject: [PATCH] support join --- src/client/src/tscSQLParser.c | 2 +- tests/script/sh/demo.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index c684d69d13..554f78f2d7 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 af2008ccef..a506014a9e 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); -- GitLab