fix(query): check if table exists during creating lastrow reader.
This commit is contained in:
parent
b253d4a07a
commit
6e709dc2e0
|
@ -136,8 +136,7 @@ int64_t tsdbGetNumOfRowsInMemTable(STsdbReader *pHandle);
|
||||||
void *tsdbGetIdx(SMeta *pMeta);
|
void *tsdbGetIdx(SMeta *pMeta);
|
||||||
void *tsdbGetIvtIdx(SMeta *pMeta);
|
void *tsdbGetIvtIdx(SMeta *pMeta);
|
||||||
|
|
||||||
int32_t tsdbLastRowReaderOpen(void *pVnode, int32_t type, SArray *pTableIdList, int32_t *colId, int32_t numOfCols,
|
int32_t tsdbLastRowReaderOpen(void *pVnode, int32_t type, SArray *pTableIdList, int32_t numOfCols, void **pReader);
|
||||||
void **pReader);
|
|
||||||
int32_t tsdbRetrieveLastRow(void *pReader, SSDataBlock *pResBlock, const int32_t *slotIds);
|
int32_t tsdbRetrieveLastRow(void *pReader, SSDataBlock *pResBlock, const int32_t *slotIds);
|
||||||
int32_t tsdbLastrowReaderClose(void *pReader);
|
int32_t tsdbLastrowReaderClose(void *pReader);
|
||||||
int32_t tsdbGetTableSchema(SVnode* pVnode, int64_t uid, STSchema** pSchema, int64_t* suid);
|
int32_t tsdbGetTableSchema(SVnode* pVnode, int64_t uid, STSchema** pSchema, int64_t* suid);
|
||||||
|
|
|
@ -70,6 +70,11 @@ int32_t tsdbLastRowReaderOpen(void* pVnode, int32_t type, SArray* pTableIdList,
|
||||||
p->numOfCols = numOfCols;
|
p->numOfCols = numOfCols;
|
||||||
p->transferBuf = taosMemoryCalloc(p->numOfCols, POINTER_BYTES);
|
p->transferBuf = taosMemoryCalloc(p->numOfCols, POINTER_BYTES);
|
||||||
|
|
||||||
|
if (taosArrayGetSize(pTableIdList) == 0) {
|
||||||
|
*pReader = p;
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
STableKeyInfo* pKeyInfo = taosArrayGet(pTableIdList, 0);
|
STableKeyInfo* pKeyInfo = taosArrayGet(pTableIdList, 0);
|
||||||
p->pSchema = metaGetTbTSchema(p->pVnode->pMeta, pKeyInfo->uid, -1);
|
p->pSchema = metaGetTbTSchema(p->pVnode->pMeta, pKeyInfo->uid, -1);
|
||||||
p->pTableList = pTableIdList;
|
p->pTableList = pTableIdList;
|
||||||
|
|
Loading…
Reference in New Issue