From 144a0c573b87e15f36c36f3b717635c07612a77d Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 27 Sep 2022 16:17:03 +0800 Subject: [PATCH] fix(query): set schema info for inner reader. --- source/dnode/vnode/src/tsdb/tsdbRead.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index b403ad2e86..b76b6b6280 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -3410,10 +3410,14 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, SArray* pTabl // we need only one row pPrevReader->capacity = 1; pPrevReader->status.pTableMap = pReader->status.pTableMap; + pPrevReader->pSchema = pReader->pSchema; + pPrevReader->pMemSchema = pReader->pMemSchema; pPrevReader->pReadSnap = pReader->pReadSnap; pNextReader->capacity = 1; pNextReader->status.pTableMap = pReader->status.pTableMap; + pNextReader->pSchema = pReader->pSchema; + pNextReader->pMemSchema = pReader->pMemSchema; pNextReader->pReadSnap = pReader->pReadSnap; code = doOpenReaderImpl(pPrevReader); @@ -3447,11 +3451,19 @@ void tsdbReaderClose(STsdbReader* pReader) { { if (pReader->innerReader[0] != NULL) { - pReader->innerReader[0]->status.pTableMap = NULL; - pReader->innerReader[0]->pReadSnap = NULL; + STsdbReader* p = pReader->innerReader[0]; - pReader->innerReader[1]->status.pTableMap = NULL; - pReader->innerReader[1]->pReadSnap = NULL; + p->status.pTableMap = NULL; + p->pReadSnap = NULL; + p->pSchema = NULL; + p->pMemSchema = NULL; + + p = pReader->innerReader[1]; + + p->status.pTableMap = NULL; + p->pReadSnap = NULL; + p->pSchema = NULL; + p->pMemSchema = NULL; tsdbReaderClose(pReader->innerReader[0]); tsdbReaderClose(pReader->innerReader[1]); -- GitLab