提交 76ef412d 编写于 作者: C Cary Xu

enh: prefer to use latest schema

上级 5fa27b27
...@@ -182,10 +182,10 @@ int tsdbUnlockRepo(STsdb *pTsdb); ...@@ -182,10 +182,10 @@ int tsdbUnlockRepo(STsdb *pTsdb);
static FORCE_INLINE STSchema *tsdbGetTableSchemaImpl(STsdb *pTsdb, STable *pTable, bool lock, bool copy, static FORCE_INLINE STSchema *tsdbGetTableSchemaImpl(STsdb *pTsdb, STable *pTable, bool lock, bool copy,
int32_t version) { int32_t version) {
if (version < 0) { if ((version < 0) || (schemaVersion(pTable->pSchema) == version)) {
return pTable->pSchema; return pTable->pSchema;
} }
if (!pTable->pCacheSchema || (schemaVersion(pTable->pCacheSchema) != version)) { if (!pTable->pCacheSchema || (schemaVersion(pTable->pCacheSchema) != version)) {
taosMemoryFreeClear(pTable->pCacheSchema); taosMemoryFreeClear(pTable->pCacheSchema);
pTable->pCacheSchema = metaGetTbTSchema(REPO_META(pTsdb), pTable->uid, version); pTable->pCacheSchema = metaGetTbTSchema(REPO_META(pTsdb), pTable->uid, version);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册