diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index ff796cdcbf5cdc7a3d9fbc313226cb9e013b0eda..dd4ff7eb57f20cfc8d31328630fbb14b7acf7017 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -567,7 +567,7 @@ static FORCE_INLINE void convertToSKVRow(SMemRow dest, SMemRow src, SSchema *pSc SKVRow kvRow = memRowKvBody(dest); memRowSetType(dest, SMEM_ROW_KV); - memRowSetKvVersion(kvRow, dataRowVersion(dataRow)); + memRowSetKvVersion(dest, dataRowVersion(dataRow)); kvRowSetNCols(kvRow, nBoundCols); kvRowSetLen(kvRow, (TDRowLenT)(TD_KV_ROW_HEAD_SIZE + sizeof(SColIdx) * nBoundCols)); diff --git a/src/tsdb/inc/tsdbMeta.h b/src/tsdb/inc/tsdbMeta.h index 8ce5e7ade80b2006ac8c39fec178994073c5a26d..5bf36aad8071fdf01b0140f3e440fcce9bd6eac6 100644 --- a/src/tsdb/inc/tsdbMeta.h +++ b/src/tsdb/inc/tsdbMeta.h @@ -110,10 +110,12 @@ static FORCE_INLINE STSchema* tsdbGetTableSchemaImpl(STable* pTable, bool lock, } else { // get the schema with version void* ptr = taosArraySearch(pDTable->schema, &_version, tsdbCompareSchemaVersion, TD_EQ); if (ptr == NULL) { - terrno = TSDB_CODE_TDB_IVD_TB_SCHEMA_VERSION; - goto _exit; + pTSchema = *(STSchema**)taosArrayGetLast(pDTable->schema); + // terrno = TSDB_CODE_TDB_IVD_TB_SCHEMA_VERSION; + // goto _exit; + } else { + pTSchema = *(STSchema**)ptr; } - pTSchema = *(STSchema**)ptr; } ASSERT(pTSchema != NULL); @@ -124,7 +126,7 @@ static FORCE_INLINE STSchema* tsdbGetTableSchemaImpl(STable* pTable, bool lock, pSchema = pTSchema; } -_exit: + // _exit: if (lock) TSDB_RUNLOCK_TABLE(pDTable); return pSchema; }