提交 18bad966 编写于 作者: S shenglian zhou 提交者: shenglian zhou

[TD-11389]<fix>(query):fix for normal table that has not tags schema

上级 833cda17
......@@ -115,6 +115,8 @@ int32_t qCreateQueryInfo(void* tsdb, int32_t vgId, SQueryTableMsg* pQueryMsg, qi
bool isSTableQuery = false;
STableGroupInfo tableGroupInfo = {0};
tableGroupInfo.sVersion = -1;
tableGroupInfo.tVersion = -1;
int64_t st = taosGetTimestampUs();
if (TSDB_QUERY_HAS_TYPE(pQueryMsg->queryType, TSDB_QUERY_TYPE_TABLE_QUERY)) {
......
......@@ -3970,7 +3970,7 @@ int32_t tsdbQuerySTableByTagCond(STsdbRepo* tsdb, uint64_t uid, TSKEY skey, cons
//NOTE: not add ref count for super table
res = taosArrayInit(8, sizeof(STableKeyInfo));
STSchema* pTagSchema = tsdbGetTableTagSchema(pTable);
assert(pTagSchema != NULL);
// no tags and tbname condition, all child tables of this stable are involved
if (pTagCond == NULL || len == 0) {
int32_t ret = getAllTableList(pTable, res);
......@@ -4071,7 +4071,9 @@ int32_t tsdbGetOneTableGroup(STsdbRepo* tsdb, uint64_t uid, TSKEY startKey, STab
taosArrayPush(pGroupInfo->pGroupList, &group);
pGroupInfo->sVersion = tsdbGetTableSchema(pTable)->version;
pGroupInfo->tVersion = tsdbGetTableTagSchema(pTable)->version;
if (tsdbGetTableTagSchema(pTable) != NULL) {
pGroupInfo->tVersion = tsdbGetTableTagSchema(pTable)->version;
}
return TSDB_CODE_SUCCESS;
_error:
......@@ -4118,6 +4120,7 @@ int32_t tsdbGetTableGroupFromIdList(STsdbRepo* tsdb, SArray* pTableIdList, STabl
assert (sVersion == tsdbGetTableSchema(pTable)->version);
}
assert(tsdbGetTableTagSchema(pTable) != NULL);
if (tVersion == -1) {
tVersion = tsdbGetTableTagSchema(pTable)->version;
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册