diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c index 8f17d500ab..434667e179 100644 --- a/source/libs/parser/src/parInsert.c +++ b/source/libs/parser/src/parInsert.c @@ -2040,6 +2040,10 @@ int32_t qBuildStmtTagFields(void* pBlock, void* boundTags, int32_t* fieldNum, TA return TSDB_CODE_QRY_APP_ERROR; } + if (pDataBlock->pTableMeta->tableType != TSDB_SUPER_TABLE && pDataBlock->pTableMeta->tableType != TSDB_CHILD_TABLE) { + return TSDB_CODE_TSC_STMT_API_ERROR; + } + SSchema* pSchema = getTableTagSchema(pDataBlock->pTableMeta); if (tags->numOfBound <= 0) { *fieldNum = 0; diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 1ba47d0d15..d34dd81d4f 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -817,6 +817,10 @@ static EDealRes translateArithmeticOperator(STranslateContext* pCxt, SOperatorNo return DEAL_RES_CONTINUE; } +static bool dataTypeEqual(const SDataType* l, const SDataType* r) { + return (l->type == r->type && l->bytes == r->bytes && l->precision == r->precision && l->scale == r->scale); +} + static EDealRes translateComparisonOperator(STranslateContext* pCxt, SOperatorNode* pOp) { SDataType ldt = ((SExprNode*)(pOp->pLeft))->resType; SDataType rdt = ((SExprNode*)(pOp->pRight))->resType; @@ -824,7 +828,20 @@ static EDealRes translateComparisonOperator(STranslateContext* pCxt, SOperatorNo return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_WRONG_VALUE_TYPE, ((SExprNode*)(pOp->pRight))->aliasName); } if (OP_TYPE_IN == pOp->opType || OP_TYPE_NOT_IN == pOp->opType) { - ((SExprNode*)pOp->pRight)->resType = ((SExprNode*)pOp->pLeft)->resType; + SNodeListNode* pRight = (SNodeListNode*)pOp->pRight; + bool first = true; + SDataType targetDt = {0}; + SNode* pNode = NULL; + FOREACH(pNode, pRight->pNodeList) { + SDataType dt = ((SExprNode*)pNode)->resType; + if (first) { + targetDt = dt; + first = false; + } else if (!dataTypeEqual(&dt, &targetDt)) { + return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_WRONG_VALUE_TYPE, ((SExprNode*)pNode)->aliasName); + } + } + pRight->dataType = targetDt; } if (nodesIsRegularOp(pOp)) { if (!IS_VAR_DATA_TYPE(((SExprNode*)(pOp->pLeft))->resType.type)) { @@ -2015,10 +2032,6 @@ static SNode* createSetOperProject(const char* pTableAlias, SNode* pNode) { return (SNode*)pCol; } -static bool dataTypeEqual(const SDataType* l, const SDataType* r) { - return (l->type == r->type && l->bytes == r->bytes && l->precision == r->precision && l->scale == r->scale); -} - static int32_t createCastFunc(STranslateContext* pCxt, SNode* pExpr, SDataType dt, SNode** pCast) { SFunctionNode* pFunc = nodesMakeNode(QUERY_NODE_FUNCTION); if (NULL == pFunc) { diff --git a/source/libs/qworker/src/qwDbg.c b/source/libs/qworker/src/qwDbg.c index 3914541157..368c3bb517 100644 --- a/source/libs/qworker/src/qwDbg.c +++ b/source/libs/qworker/src/qwDbg.c @@ -9,7 +9,7 @@ #include "tmsg.h" #include "tname.h" -SQWDebug gQWDebug = {.statusEnable = true, .dumpEnable = true}; +SQWDebug gQWDebug = {.statusEnable = true, .dumpEnable = false}; int32_t qwDbgValidateStatus(QW_FPARAMS_DEF, int8_t oriStatus, int8_t newStatus, bool *ignore) { if (!gQWDebug.statusEnable) { @@ -97,7 +97,11 @@ _return: QW_RET(code); } -void qwDbgDumpSchInfo(SQWSchStatus *sch, int32_t i) {} +void qwDbgDumpSchInfo(SQWorker *mgmt, SQWSchStatus *sch, int32_t i) { + QW_LOCK(QW_READ, &sch->tasksLock); + QW_DLOG("the %dth scheduler status, hbBrokenTs:%" PRId64 ",taskNum:%d", i, sch->hbBrokenTs, taosHashGetSize(sch->tasksHash)); + QW_UNLOCK(QW_READ, &sch->tasksLock); +} void qwDbgDumpMgmtInfo(SQWorker *mgmt) { if (!gQWDebug.dumpEnable) { @@ -106,7 +110,7 @@ void qwDbgDumpMgmtInfo(SQWorker *mgmt) { QW_LOCK(QW_READ, &mgmt->schLock); - /*QW_DUMP("total remain schduler num:%d", taosHashGetSize(mgmt->schHash));*/ + QW_DUMP("total remain scheduler num %d", taosHashGetSize(mgmt->schHash)); void *key = NULL; size_t keyLen = 0; @@ -116,14 +120,14 @@ void qwDbgDumpMgmtInfo(SQWorker *mgmt) { void *pIter = taosHashIterate(mgmt->schHash, NULL); while (pIter) { sch = (SQWSchStatus *)pIter; - qwDbgDumpSchInfo(sch, i); + qwDbgDumpSchInfo(mgmt, sch, i); ++i; pIter = taosHashIterate(mgmt->schHash, pIter); } QW_UNLOCK(QW_READ, &mgmt->schLock); - /*QW_DUMP("total remain ctx num:%d", taosHashGetSize(mgmt->ctxHash));*/ + QW_DUMP("total remain ctx num %d", taosHashGetSize(mgmt->ctxHash)); } diff --git a/source/libs/scalar/src/filter.c b/source/libs/scalar/src/filter.c index 12e9ec5aea..6704bfdde3 100644 --- a/source/libs/scalar/src/filter.c +++ b/source/libs/scalar/src/filter.c @@ -3669,6 +3669,14 @@ EDealRes fltReviseRewriter(SNode** pNode, void* pContext) { stat->scalarMode = true; return DEAL_RES_CONTINUE; } + } else { + SColumnNode *refNode = (SColumnNode *)node->pLeft; + SNodeListNode *listNode = (SNodeListNode *)node->pRight; + int32_t type = vectorGetConvertType(refNode->node.resType.type, listNode->dataType.type); + if (0 != type && type != refNode->node.resType.type) { + stat->scalarMode = true; + return DEAL_RES_CONTINUE; + } } }