提交 9a410b96 编写于 作者: M Minglei Jin

fix(query): new META_READER_NOLOCK flag for metaReaderInit

上级 997dfb41
......@@ -91,6 +91,8 @@ typedef struct SMeta SMeta; // todo: remove
typedef struct SMetaReader SMetaReader;
typedef struct SMetaEntry SMetaEntry;
#define META_READER_NOLOCK 0x1
void metaReaderInit(SMetaReader *pReader, SMeta *pMeta, int32_t flags);
void metaReaderClear(SMetaReader *pReader);
int32_t metaGetTableEntryByUid(SMetaReader *pReader, tb_uid_t uid);
......
......@@ -19,11 +19,13 @@ void metaReaderInit(SMetaReader *pReader, SMeta *pMeta, int32_t flags) {
memset(pReader, 0, sizeof(*pReader));
pReader->flags = flags;
pReader->pMeta = pMeta;
if (!(flags & META_READER_NOLOCK)) {
metaRLock(pMeta);
}
}
void metaReaderClear(SMetaReader *pReader) {
if (pReader->pMeta) {
if (pReader->pMeta && !(pReader->flags & META_READER_NOLOCK)) {
metaULock(pReader->pMeta);
}
tDecoderClear(&pReader->coder);
......
......@@ -2757,7 +2757,7 @@ static SSDataBlock* sysTableScanUserTables(SOperatorInfo* pOperator) {
colDataAppend(pColInfoData, numOfRows, (char*)&ts, false);
SMetaReader mr = {0};
metaReaderInit(&mr, pInfo->readHandle.meta, 0);
metaReaderInit(&mr, pInfo->readHandle.meta, META_READER_NOLOCK);
uint64_t suid = pInfo->pCur->mr.me.ctbEntry.suid;
int32_t code = metaGetTableEntryByUid(&mr, suid);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册