diff --git a/src/cq/src/cqMain.c b/src/cq/src/cqMain.c index d4a874c97a742810f7ccc777bc7976296b783481..f620eb4dd55754146ddd164d372bb1233cf94aba 100644 --- a/src/cq/src/cqMain.c +++ b/src/cq/src/cqMain.c @@ -326,8 +326,10 @@ void *cqCreate(void *handle, uint64_t uid, int32_t sid, const char* dstTable, ch pObj->rid = taosAddRef(cqObjRef, pObj); - if(start) { + if(start && pContext->master) { cqCreateStream(pContext, pObj); + } else { + pObj->pContext = pContext; } rid = pObj->rid;