提交 418db189 编写于 作者: S shenglian zhou

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

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