fix: some problems of planner
This commit is contained in:
parent
b08a28d559
commit
15a08b9999
|
@ -2684,6 +2684,7 @@ static int32_t jsonToDataType(const SJson* pJson, void* pObj) {
|
|||
|
||||
static const char* jkExprDataType = "DataType";
|
||||
static const char* jkExprAliasName = "AliasName";
|
||||
static const char* jkExprUserAlias = "UserAlias";
|
||||
|
||||
static int32_t exprNodeToJson(const void* pObj, SJson* pJson) {
|
||||
const SExprNode* pNode = (const SExprNode*)pObj;
|
||||
|
@ -2692,6 +2693,9 @@ static int32_t exprNodeToJson(const void* pObj, SJson* pJson) {
|
|||
if (TSDB_CODE_SUCCESS == code) {
|
||||
code = tjsonAddStringToObject(pJson, jkExprAliasName, pNode->aliasName);
|
||||
}
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
code = tjsonAddStringToObject(pJson, jkExprUserAlias, pNode->userAlias);
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
@ -2703,6 +2707,9 @@ static int32_t jsonToExprNode(const SJson* pJson, void* pObj) {
|
|||
if (TSDB_CODE_SUCCESS == code) {
|
||||
code = tjsonGetStringValue(pJson, jkExprAliasName, pNode->aliasName);
|
||||
}
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
code = tjsonGetStringValue(pJson, jkExprUserAlias, pNode->userAlias);
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
|
|
@ -1502,7 +1502,7 @@ static EDealRes collectColumns(SNode* pNode, void* pContext) {
|
|||
SCollectColumnsCxt* pCxt = (SCollectColumnsCxt*)pContext;
|
||||
if (QUERY_NODE_COLUMN == nodeType(pNode)) {
|
||||
SColumnNode* pCol = (SColumnNode*)pNode;
|
||||
if (isCollectType(pCxt->collectType, pCol->colType) &&
|
||||
if (isCollectType(pCxt->collectType, pCol->colType) && 0 != strcmp(pCol->colName, "*") &&
|
||||
(NULL == pCxt->pTableAlias || 0 == strcmp(pCxt->pTableAlias, pCol->tableAlias))) {
|
||||
return doCollect(pCxt, pCol, pNode);
|
||||
}
|
||||
|
|
|
@ -73,3 +73,9 @@ TEST_F(PlanSubqeuryTest, outerInterval) {
|
|||
|
||||
run("SELECT COUNT(*) FROM (SELECT ts, TOP(c1, 10) FROM st1s1) INTERVAL(5s)");
|
||||
}
|
||||
|
||||
TEST_F(PlanSubqeuryTest, outerPartition) {
|
||||
useDb("root", "test");
|
||||
|
||||
run("SELECT c1, COUNT(*) FROM (SELECT ts, c1 FROM st1) PARTITION BY c1");
|
||||
}
|
||||
|
|
|
@ -2631,7 +2631,7 @@ sql_error select tb1.ts,tb1.c1,tb2_1.u1 from tb1, tb2_1 where tb1.ts=tb2_1.ts or
|
|||
|
||||
|
||||
print "ts&tbname test"
|
||||
sql_error select count(*) from stb1 where ts > 0 or tbname like 'tb%';
|
||||
sql select count(*) from stb1 where ts > 0 or tbname like 'tb%';
|
||||
|
||||
print "ts&tag test"
|
||||
sql select count(*) from stb1 where ts > 0 or t1 > 0;
|
||||
|
@ -2717,9 +2717,9 @@ print "tbname&tag&join test"
|
|||
|
||||
|
||||
print "column&ts&tbname&tag test"
|
||||
sql_error select * from stb1 where (tbname like 'tb%' or ts > '2021-05-05 18:19:01.000') and (t1 > 5 or t1 < 4) and c1 > 0;
|
||||
sql select * from stb1 where (tbname like 'tb%' or ts > '2021-05-05 18:19:01.000') and (t1 > 5 or t1 < 4) and c1 > 0;
|
||||
sql select * from stb1 where (ts > '2021-05-05 18:19:01.000') and (ts > '2021-05-05 18:19:02.000' or t1 > 3) and (t1 > 5 or t1 < 4) and c1 > 0;
|
||||
sql_error select ts,c1,c7 from stb1 where ts > '2021-05-05 18:19:03.000' or ts > '2021-05-05 18:19:20.000' and col > 0 and t1 > 0;
|
||||
sql select ts,c1,c7 from stb1 where ts > '2021-05-05 18:19:03.000' or ts > '2021-05-05 18:19:20.000' and c1 > 0 and t1 > 0;
|
||||
|
||||
|
||||
print "column&ts&tbname&join test"
|
||||
|
|
Loading…
Reference in New Issue