提交 2eb18e10 编写于 作者: H Haojun Liao

[td-225] add test cases.

上级 54fcf516
...@@ -7370,7 +7370,6 @@ static int32_t doValidateSubquery(SSqlNode* pSqlNode, int32_t index, SSqlObj* pS ...@@ -7370,7 +7370,6 @@ static int32_t doValidateSubquery(SSqlNode* pSqlNode, int32_t index, SSqlObj* pS
SSqlNode* p = taosArrayGetP(subInfo->pSubquery, 0); SSqlNode* p = taosArrayGetP(subInfo->pSubquery, 0);
SQueryInfo* pSub = calloc(1, sizeof(SQueryInfo)); SQueryInfo* pSub = calloc(1, sizeof(SQueryInfo));
printf("-------------queryinfo:%p\n", pSub);
tscInitQueryInfo(pSub); tscInitQueryInfo(pSub);
int32_t code = validateSqlNode(pSql, p, pSub); int32_t code = validateSqlNode(pSql, p, pSub);
......
...@@ -1614,6 +1614,7 @@ int tscProcessRetrieveLocalMergeRsp(SSqlObj *pSql) { ...@@ -1614,6 +1614,7 @@ int tscProcessRetrieveLocalMergeRsp(SSqlObj *pSql) {
taosArrayPush(group, &tableKeyInfo); taosArrayPush(group, &tableKeyInfo);
taosArrayPush(tableGroupInfo.pGroupList, &group); taosArrayPush(tableGroupInfo.pGroupList, &group);
// todo remove it
SExprInfo* list = calloc(tscNumOfExprs(pQueryInfo), sizeof(SExprInfo)); SExprInfo* list = calloc(tscNumOfExprs(pQueryInfo), sizeof(SExprInfo));
for(int32_t i = 0; i < tscNumOfExprs(pQueryInfo); ++i) { for(int32_t i = 0; i < tscNumOfExprs(pQueryInfo); ++i) {
SExprInfo* pExprInfo = tscExprGet(pQueryInfo, i); SExprInfo* pExprInfo = tscExprGet(pQueryInfo, i);
...@@ -1621,6 +1622,7 @@ int tscProcessRetrieveLocalMergeRsp(SSqlObj *pSql) { ...@@ -1621,6 +1622,7 @@ int tscProcessRetrieveLocalMergeRsp(SSqlObj *pSql) {
} }
pQueryInfo->pQInfo = createQInfoFromQueryNode(pQueryInfo, list, &tableGroupInfo, NULL, NULL, pRes->pLocalMerger, MERGE_STAGE); pQueryInfo->pQInfo = createQInfoFromQueryNode(pQueryInfo, list, &tableGroupInfo, NULL, NULL, pRes->pLocalMerger, MERGE_STAGE);
tfree(list);
} }
uint64_t localQueryId = 0; uint64_t localQueryId = 0;
......
...@@ -1010,6 +1010,11 @@ void handleDownstreamOperator(SSqlObj** pSqlObjList, int32_t numOfUpstream, SQue ...@@ -1010,6 +1010,11 @@ void handleDownstreamOperator(SSqlObj** pSqlObjList, int32_t numOfUpstream, SQue
pSourceOperator = createJoinOperator(p, px->numOfTables, schema, num); pSourceOperator = createJoinOperator(p, px->numOfTables, schema, num);
tfree(p); tfree(p);
} else {
int32_t num = taosArrayGetSize(px->colList);
schema = calloc(num, sizeof(SSchema));
memcpy(schema, pSchema, numOfCol1*sizeof(SSchema));
} }
SExprInfo* exprInfo = NULL; SExprInfo* exprInfo = NULL;
......
...@@ -61,6 +61,43 @@ sleep 100 ...@@ -61,6 +61,43 @@ sleep 100
$i = 1 $i = 1
$tb = $tbPrefix . $i $tb = $tbPrefix . $i
sql select count(*) from (select
print simple nest query test
sql select count(*) from (select count(*) from nest_mt0))
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
sql select count(*) from (select count(*) from nest_mt0 group by tbname)
if $rows != 1 then
return -1
endi
if $data00 != 10 then
return -1
endi
sql select count(*) from (select count(*) from nest_mt0 interval(10h) group by tbname)
if $rows != 1 then
return -1
endi
if $data00 != 10 then
return -1
endi
print =================> alias name test
sql select count(a) from (select count(*) a from nest_tb0 interval(1h))
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册