提交 296902b3 编写于 作者: D dapan1121

Merge branch 'feature/TD-4034' into feature/TD-3950

...@@ -616,17 +616,34 @@ static void tsdbStopStream(STsdbRepo *pRepo) { ...@@ -616,17 +616,34 @@ static void tsdbStopStream(STsdbRepo *pRepo) {
} }
} }
static STSchema* getTableLatestSchema(STable *pTable) {
if (pTable->numOfSchemas > 0) {
return pTable->schema[pTable->numOfSchemas - 1];
}
if (pTable->type == TSDB_CHILD_TABLE) {
if (pTable->pSuper && pTable->pSuper->numOfSchemas) {
tsdbDebug("getTableLatestSchema of table %s from super table %s", pTable->name->data, pTable->pSuper->name->data);
return pTable->pSuper->schema[pTable->pSuper->numOfSchemas - 1];
}
}
return NULL;
}
static int restoreLastColumns(STsdbRepo *pRepo, STable *pTable, SReadH* pReadh) { static int restoreLastColumns(STsdbRepo *pRepo, STable *pTable, SReadH* pReadh) {
if (pTable->numOfSchemas == 0) { STSchema *pSchema = getTableLatestSchema(pTable);
if (pSchema == NULL) {
tsdbError("getTableLatestSchema of table %s fail", pTable->name->data);
return 0; return 0;
} }
SBlock* pBlock; SBlock* pBlock;
int numColumns; int numColumns;
int32_t blockIdx; int32_t blockIdx;
SDataStatis* pBlockStatis = NULL; SDataStatis* pBlockStatis = NULL;
SDataRow row = NULL; SDataRow row = NULL;
// restore last column data with last schema // restore last column data with last schema
STSchema *pSchema = pTable->schema[pTable->numOfSchemas - 1];
int err = 0; int err = 0;
numColumns = schemaNCols(pSchema); numColumns = schemaNCols(pSchema);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册