diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 4a3c4b0c3f236557ffe4e28ff7cedce3e82093fa..5453c8d0ea19e0bbc33c651f3a9d3acf73814b03 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -2500,6 +2500,7 @@ typedef struct { int64_t sliding; int64_t dstTbUid; int32_t dstVgId; // for stream + SEpSet epSet; char* expr; } STableIndexInfo; diff --git a/include/libs/function/function.h b/include/libs/function/function.h index e8cb363e08fa65385d36762face331f5de5cf1eb..810991f770a87c7697b97129f1a5a637c63abe61 100644 --- a/include/libs/function/function.h +++ b/include/libs/function/function.h @@ -197,6 +197,7 @@ typedef struct SAggFunctionInfo { struct SScalarParam { SColumnInfoData *columnData; SHashObj *pHashFilter; + int32_t hashValueType; void *param; // other parameter, such as meta handle from vnode, to extract table name/tag value int32_t numOfRows; }; diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 51c40827b5f4854f19013ebedc2159c6990097d9..b9b4556255f5b4a2b9dbe5ff22fb2037f5c4e875 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -2427,6 +2427,7 @@ int32_t tSerializeSTableIndexInfo(SEncoder *pEncoder, STableIndexInfo* pInfo) { if (tEncodeI64(pEncoder, pInfo->sliding) < 0) return -1; if (tEncodeI64(pEncoder, pInfo->dstTbUid) < 0) return -1; if (tEncodeI32(pEncoder, pInfo->dstVgId) < 0) return -1; + if (tEncodeSEpSet(pEncoder, &pInfo->epSet) < 0) return -1; if (tEncodeCStr(pEncoder, pInfo->expr) < 0) return -1; return 0; } @@ -2459,6 +2460,7 @@ int32_t tDeserializeSTableIndexInfo(SDecoder *pDecoder, STableIndexInfo *pInfo) if (tDecodeI64(pDecoder, &pInfo->sliding) < 0) return -1; if (tDecodeI64(pDecoder, &pInfo->dstTbUid) < 0) return -1; if (tDecodeI32(pDecoder, &pInfo->dstVgId) < 0) return -1; + if (tDecodeSEpSet(pDecoder, &pInfo->epSet) < 0) return -1; if (tDecodeCStrAlloc(pDecoder, &pInfo->expr) < 0) return -1; return 0; diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c index 1d47f8fc7a1da9cfc5cd2e0ec4d90885bb5b0de1..cde36eac5802a7b10d464c4d478a3e5788dad45e 100644 --- a/source/dnode/mnode/impl/src/mndSma.c +++ b/source/dnode/mnode/impl/src/mndSma.c @@ -894,6 +894,15 @@ static int32_t mndGetTableSma(SMnode *pMnode, STableIndexReq *indexReq, STableIn info.sliding = pSma->sliding; info.dstTbUid = pSma->dstTbUid; info.dstVgId = pSma->dstVgId; + + SVgObj* pVg = mndAcquireVgroup(pMnode, pSma->dstVgId); + if (pVg == NULL) { + code = -1; + sdbRelease(pSdb, pSma); + return code; + } + info.epSet = mndGetVgroupEpset(pMnode, pVg); + info.expr = taosMemoryMalloc(pSma->exprLen + 1); if (info.expr == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; diff --git a/source/libs/command/inc/commandInt.h b/source/libs/command/inc/commandInt.h index a3755a174ea87fd8766a29509df5eed229dabdf2..c8412afdc7a88cd057a76a123abb2723b5ac1185 100644 --- a/source/libs/command/inc/commandInt.h +++ b/source/libs/command/inc/commandInt.h @@ -115,9 +115,9 @@ typedef struct SExplainCtx { #define EXPLAIN_ROW_NEW(level, ...) \ do { \ if (isVerboseLine) { \ - tlen = snprintf(tbuf + VARSTR_HEADER_SIZE, TSDB_EXPLAIN_RESULT_ROW_SIZE - VARSTR_HEADER_SIZE, "%*s", (level) * 2 + 3, ""); \ + tlen = snprintf(tbuf + VARSTR_HEADER_SIZE, TSDB_EXPLAIN_RESULT_ROW_SIZE - VARSTR_HEADER_SIZE, "%*s", (level) * 3 + 3, ""); \ } else { \ - tlen = snprintf(tbuf + VARSTR_HEADER_SIZE, TSDB_EXPLAIN_RESULT_ROW_SIZE - VARSTR_HEADER_SIZE, "%*s%s", (level) * 2, "", "-> "); \ + tlen = snprintf(tbuf + VARSTR_HEADER_SIZE, TSDB_EXPLAIN_RESULT_ROW_SIZE - VARSTR_HEADER_SIZE, "%*s%s", (level) * 3, "", "-> "); \ } \ tlen += snprintf(tbuf + VARSTR_HEADER_SIZE + tlen, TSDB_EXPLAIN_RESULT_ROW_SIZE - VARSTR_HEADER_SIZE - tlen, __VA_ARGS__); \ } while (0) diff --git a/source/libs/command/src/explain.c b/source/libs/command/src/explain.c index 626dfbd8fbaf1905de5f272d176ba8865bc0728d..dc9215b52797ad46c5451611b8325833fa6aefdd 100644 --- a/source/libs/command/src/explain.c +++ b/source/libs/command/src/explain.c @@ -658,7 +658,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i if (EXPLAIN_MODE_ANALYZE == ctx->mode) { // sort key - EXPLAIN_ROW_NEW(level, "Sort Key: "); + EXPLAIN_ROW_NEW(level + 1, "Sort Key: "); if (pResNode->pExecInfo) { for (int32_t i = 0; i < LIST_LENGTH(pSortNode->pSortKeys); ++i) { SOrderByExprNode *ptn = nodesListGetNode(pSortNode->pSortKeys, i); @@ -670,7 +670,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i QRY_ERR_RET(qExplainResAppendRow(ctx, tbuf, tlen, level)); // sort method - EXPLAIN_ROW_NEW(level, "Sort Method: "); + EXPLAIN_ROW_NEW(level + 1, "Sort Method: "); int32_t nodeNum = taosArrayGetSize(pResNode->pExecInfo); SExplainExecInfo *execInfo = taosArrayGet(pResNode->pExecInfo, 0); diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c index 2cfc06b5755cf21fe39eda7ed5b6460c6b1993a4..54c8a1821809ffe867addf788027b54123c1a989 100644 --- a/source/libs/parser/src/parInsert.c +++ b/source/libs/parser/src/parInsert.c @@ -2043,6 +2043,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 c5c056bea36ac25c0abfdc44b77231ff327abdc3..96a5c09bbff918d26c725aada44591297704f54f 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -812,6 +812,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; @@ -819,7 +823,24 @@ 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; + if (targetDt.type != TSDB_DATA_TYPE_NULL) { + first = false; + } + } else if (dt.type != targetDt.type && dt.type != TSDB_DATA_TYPE_NULL) { + return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_WRONG_VALUE_TYPE, ((SExprNode*)pNode)->aliasName); + } else if (dt.bytes > targetDt.bytes) { + targetDt.bytes = dt.bytes; + } + } + pRight->dataType = targetDt; } if (nodesIsRegularOp(pOp)) { if (!IS_VAR_DATA_TYPE(((SExprNode*)(pOp->pLeft))->resType.type)) { @@ -2010,10 +2031,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 3914541157e86aa67a55c56cd56afb76da2061cf..368c3bb517e18c8b9254f4d90bdd4b8aa5bb0d2d 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/inc/sclInt.h b/source/libs/scalar/inc/sclInt.h index 1c2e4a358a2c256cf3ed577be568c2e93fe13cbe..4dd16098ff3df97185c4a6f249a12882456d111d 100644 --- a/source/libs/scalar/inc/sclInt.h +++ b/source/libs/scalar/inc/sclInt.h @@ -22,11 +22,18 @@ extern "C" { #include "thash.h" #include "query.h" +typedef struct SOperatorValueType { + int32_t opResType; + int32_t selfType; + int32_t peerType; +} SOperatorValueType; + typedef struct SScalarCtx { int32_t code; SArray *pBlockList; /* element is SSDataBlock* */ SHashObj *pRes; /* element is SScalarParam */ void *param; // additional parameter (meta actually) for acquire value such as tbname/tags values + SOperatorValueType type; } SScalarCtx; @@ -53,7 +60,7 @@ int32_t doConvertDataType(SValueNode* pValueNode, SScalarParam* out); SColumnInfoData* createColumnInfoData(SDataType* pType, int32_t numOfRows); int32_t sclConvertToTsValueNode(int8_t precision, SValueNode* valueNode); -#define GET_PARAM_TYPE(_c) ((_c)->columnData->info.type) +#define GET_PARAM_TYPE(_c) ((_c)->columnData ? (_c)->columnData->info.type : (_c)->hashValueType) #define GET_PARAM_BYTES(_c) ((_c)->columnData->info.bytes) #define GET_PARAM_PRECISON(_c) ((_c)->columnData->info.precision) diff --git a/source/libs/scalar/src/filter.c b/source/libs/scalar/src/filter.c index 12e9ec5aea3146c1804697b97bf156415fce73c7..6704bfdde32357dde928f0a29dda8fd1a1bcc299 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; + } } } diff --git a/source/libs/scalar/src/scalar.c b/source/libs/scalar/src/scalar.c index d2436b9948f2cf7bfa15d061cdc9bbfdfefd6f08..66e4af5ded0404b9f5b2ec7e9b8097178613c2c6 100644 --- a/source/libs/scalar/src/scalar.c +++ b/source/libs/scalar/src/scalar.c @@ -208,7 +208,13 @@ int32_t sclInitParam(SNode* node, SScalarParam *param, SScalarCtx *ctx, int32_t SCL_RET(TSDB_CODE_QRY_INVALID_INPUT); } - SCL_ERR_RET(scalarGenerateSetFromList((void **)¶m->pHashFilter, node, nodeList->dataType.type)); + int32_t type = vectorGetConvertType(ctx->type.selfType, ctx->type.peerType); + if (type == 0) { + type = nodeList->dataType.type; + } + + SCL_ERR_RET(scalarGenerateSetFromList((void **)¶m->pHashFilter, node, type)); + param->hashValueType = type; if (taosHashPut(ctx->pRes, &node, POINTER_BYTES, param, sizeof(*param))) { taosHashCleanup(param->pHashFilter); sclError("taosHashPut nodeList failed, size:%d", (int32_t)sizeof(*param)); @@ -334,6 +340,46 @@ _return: SCL_RET(code); } +int32_t sclGetNodeType(SNode *pNode, SScalarCtx *ctx) { + if (NULL == pNode) { + return -1; + } + + switch (nodeType(pNode)) { + case QUERY_NODE_VALUE: { + SValueNode *valueNode = (SValueNode *)pNode; + return valueNode->node.resType.type; + } + case QUERY_NODE_NODE_LIST: { + SNodeListNode *nodeList = (SNodeListNode *)pNode; + return nodeList->dataType.type; + } + case QUERY_NODE_COLUMN: { + SColumnNode *colNode = (SColumnNode *)pNode; + return colNode->node.resType.type; + } + case QUERY_NODE_FUNCTION: + case QUERY_NODE_OPERATOR: + case QUERY_NODE_LOGIC_CONDITION: { + SScalarParam *res = (SScalarParam *)taosHashGet(ctx->pRes, &pNode, POINTER_BYTES); + if (NULL == res) { + sclError("no result for node, type:%d, node:%p", nodeType(pNode), pNode); + return -1; + } + return res->columnData->info.type; + } + } + + return -1; +} + + +void sclSetOperatorValueType(SOperatorNode *node, SScalarCtx *ctx) { + ctx->type.opResType = node->node.resType.type; + ctx->type.selfType = sclGetNodeType(node->pLeft, ctx); + ctx->type.peerType = sclGetNodeType(node->pRight, ctx); +} + int32_t sclInitOperatorParams(SScalarParam **pParams, SOperatorNode *node, SScalarCtx *ctx, int32_t *rowNum) { int32_t code = 0; int32_t paramNum = scalarGetOperatorParamNum(node->opType); @@ -348,8 +394,11 @@ int32_t sclInitOperatorParams(SScalarParam **pParams, SOperatorNode *node, SScal SCL_ERR_RET(TSDB_CODE_QRY_OUT_OF_MEMORY); } + sclSetOperatorValueType(node, ctx); + SCL_ERR_JRET(sclInitParam(node->pLeft, ¶mList[0], ctx, rowNum)); if (paramNum > 1) { + TSWAP(ctx->type.selfType, ctx->type.peerType); SCL_ERR_JRET(sclInitParam(node->pRight, ¶mList[1], ctx, rowNum)); } diff --git a/source/libs/scalar/src/sclvector.c b/source/libs/scalar/src/sclvector.c index 7440a6ae5b504360483090b6a1283e3bf0f69115..7d96a89e853665af8a7c43499468ad1c52976d0c 100644 --- a/source/libs/scalar/src/sclvector.c +++ b/source/libs/scalar/src/sclvector.c @@ -627,6 +627,11 @@ int32_t vectorConvertImpl(const SScalarParam* pIn, SScalarParam* pOut) { SColumnInfoData* pInputCol = pIn->columnData; SColumnInfoData* pOutputCol = pOut->columnData; + if (NULL == pInputCol) { + sclError("input column is NULL, hashFilter %p", pIn->pHashFilter); + return TSDB_CODE_APP_ERROR; + } + int16_t inType = pInputCol->info.type; int16_t outType = pOutputCol->info.type; @@ -827,11 +832,26 @@ int32_t vectorGetConvertType(int32_t type1, int32_t type2) { return gConvertTypes[type2][type1]; } -int32_t vectorConvert(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam* pLeftOut, SScalarParam* pRightOut) { - if (pLeft->pHashFilter != NULL || pRight->pHashFilter != NULL) { - return TSDB_CODE_SUCCESS; +int32_t vectorConvertScalarParam(SScalarParam *input, SScalarParam *output, int32_t type) { + int32_t code = 0; + SDataType t = {.type = type, .bytes = tDataTypes[type].bytes}; + output->numOfRows = input->numOfRows; + + output->columnData = createColumnInfoData(&t, input->numOfRows); + if (output->columnData == NULL) { + return TSDB_CODE_OUT_OF_MEMORY; } + code = vectorConvertImpl(input, output); + if (code) { +// taosMemoryFreeClear(paramOut1->data); + return code; + } + + return TSDB_CODE_SUCCESS; +} + +int32_t vectorConvert(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam* pLeftOut, SScalarParam* pRightOut) { int32_t leftType = GET_PARAM_TYPE(pLeft); int32_t rightType = GET_PARAM_TYPE(pRight); if (leftType == rightType) { @@ -860,31 +880,14 @@ int32_t vectorConvert(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam* p } if (type != GET_PARAM_TYPE(param1)) { - SDataType t = {.type = type, .bytes = tDataTypes[type].bytes}; - paramOut1->numOfRows = param1->numOfRows; - - paramOut1->columnData = createColumnInfoData(&t, param1->numOfRows); - if (paramOut1->columnData == NULL) { - return terrno; - } - - code = vectorConvertImpl(param1, paramOut1); + code = vectorConvertScalarParam(param1, paramOut1, type); if (code) { -// taosMemoryFreeClear(paramOut1->data); return code; } } if (type != GET_PARAM_TYPE(param2)) { - SDataType t = {.type = type, .bytes = tDataTypes[type].bytes}; - paramOut2->numOfRows = param2->numOfRows; - - paramOut2->columnData = createColumnInfoData(&t, param2->numOfRows); - if (paramOut2->columnData == NULL) { - return terrno; - } - - code = vectorConvertImpl(param2, paramOut2); + code = vectorConvertScalarParam(param2, paramOut2, type); if (code) { return code; } diff --git a/tests/system-test/2-query/query_cols_tags_and_or.py b/tests/system-test/2-query/query_cols_tags_and_or.py index 5dc5a2f1236ea1d73f3a4a7f4775ec5133adc8d1..f8a44f735f27d9b13d88eea35936ad39c463a3ed 100644 --- a/tests/system-test/2-query/query_cols_tags_and_or.py +++ b/tests/system-test/2-query/query_cols_tags_and_or.py @@ -1066,9 +1066,7 @@ class TDTestCase: tdSql.checkEqual(self.queryLastC10(query_sql), 11) if select_elm == "*" else False # in query_sql = f'select {select_elm} from {tb_name} where c5 in (1, 6.6)' - tdSql.query(query_sql) - tdSql.checkRows(1) - tdSql.checkEqual(self.queryLastC10(query_sql), 6) if select_elm == "*" else False + tdSql.error(query_sql) # not in query_sql = f'select {select_elm} from {tb_name} where c5 not in (2, 3)' tdSql.query(query_sql) @@ -1076,14 +1074,10 @@ class TDTestCase: tdSql.checkEqual(self.queryLastC10(query_sql), 11) if select_elm == "*" else False # and query_sql = f'select {select_elm} from {tb_name} where c5 > 0 and c5 >= 1 and c5 < 7 and c5 <= 6.6 and c5 != 2 and c5 <> 2 and c5 = 6.6 and c5 is not null and c5 between 2 and 6.6 and c5 not between 1 and 2 and c5 in (2,6.6) and c5 not in (1,2)' - tdSql.query(query_sql) - tdSql.checkRows(1) - tdSql.checkEqual(self.queryLastC10(query_sql), 6) if select_elm == "*" else False + tdSql.error(query_sql) # or query_sql = f'select {select_elm} from {tb_name} where c5 > 6 or c5 >= 6.6 or c5 < 1 or c5 <= 0 or c5 != 1.1 or c5 <> 1.1 or c5 = 5 or c5 is null or c5 between 4 and 5 or c5 not between 1 and 3 or c5 in (4,5) or c5 not in (1.1,3)' - tdSql.query(query_sql) - tdSql.checkRows(1) - tdSql.checkEqual(self.queryLastC10(query_sql), 6) if select_elm == "*" else False + tdSql.error(query_sql) # and or query_sql = f'select {select_elm} from {tb_name} where c5 > 0 and c5 >= 1 or c5 < 5 and c5 <= 6.6 and c5 != 2 and c5 <> 2 and c5 = 4 or c5 is not null and c5 between 2 and 4 and c5 not between 1 and 2 and c5 in (2,4) and c5 not in (1,2)' tdSql.query(query_sql) @@ -1151,9 +1145,7 @@ class TDTestCase: tdSql.checkEqual(self.queryLastC10(query_sql), 11) if select_elm == "*" else False # in query_sql = f'select {select_elm} from {tb_name} where c6 in (1, 7.7)' - tdSql.query(query_sql) - tdSql.checkRows(1) - tdSql.checkEqual(self.queryLastC10(query_sql), 7) if select_elm == "*" else False + tdSql.error(query_sql) # not in query_sql = f'select {select_elm} from {tb_name} where c6 not in (2, 3)' tdSql.query(query_sql) @@ -1161,14 +1153,10 @@ class TDTestCase: tdSql.checkEqual(self.queryLastC10(query_sql), 11) if select_elm == "*" else False # and query_sql = f'select {select_elm} from {tb_name} where c6 > 0 and c6 >= 1 and c6 < 8 and c6 <= 7.7 and c6 != 2 and c6 <> 2 and c6 = 7.7 and c6 is not null and c6 between 2 and 7.7 and c6 not between 1 and 2 and c6 in (2,7.7) and c6 not in (1,2)' - tdSql.query(query_sql) - tdSql.checkRows(1) - tdSql.checkEqual(self.queryLastC10(query_sql), 7) if select_elm == "*" else False + tdSql.error(query_sql) # or query_sql = f'select {select_elm} from {tb_name} where c6 > 7 or c6 >= 7.7 or c6 < 1 or c6 <= 0 or c6 != 1.1 or c6 <> 1.1 or c6 = 5 or c6 is null or c6 between 4 and 5 or c6 not between 1 and 3 or c6 in (4,5) or c6 not in (1.1,3)' - tdSql.query(query_sql) - tdSql.checkRows(1) - tdSql.checkEqual(self.queryLastC10(query_sql), 7) if select_elm == "*" else False + tdSql.error(query_sql) # and or query_sql = f'select {select_elm} from {tb_name} where c6 > 0 and c6 >= 1 or c6 < 5 and c6 <= 7.7 and c6 != 2 and c6 <> 2 and c6 = 4 or c6 is not null and c6 between 2 and 4 and c6 not between 1 and 2 and c6 in (2,4) and c6 not in (1,2)' tdSql.query(query_sql) @@ -1410,9 +1398,7 @@ class TDTestCase: tdSql.checkEqual(self.queryLastC10(query_sql), 11) if select_elm == "*" else False # in query_sql = f'select {select_elm} from {tb_name} where c9 in ("binar", false)' - tdSql.query(query_sql) - tdSql.checkRows(2) - tdSql.checkEqual(self.queryLastC10(query_sql), 11) if select_elm == "*" else False + tdSql.error(query_sql) # # not in query_sql = f'select {select_elm} from {tb_name} where c9 not in (true)' tdSql.query(query_sql) @@ -1421,19 +1407,13 @@ class TDTestCase: # # and query_sql = f'select {select_elm} from {tb_name} where c9 = true and c9 != "false" and c9 <> "binary" and c9 is not null and c9 in ("binary", true) and c9 not in ("binary")' - tdSql.query(query_sql) - tdSql.checkRows(9) - tdSql.checkEqual(self.queryLastC10(query_sql), 9) if select_elm == "*" else False + tdSql.error(query_sql) # # or query_sql = f'select {select_elm} from {tb_name} where c9 = true or c9 != "false" or c9 <> "binary" or c9 = "true" or c9 is not null or c9 in ("binary", true) or c9 not in ("binary")' - tdSql.query(query_sql) - tdSql.checkRows(11) - tdSql.checkEqual(self.queryLastC10(query_sql), 11) if select_elm == "*" else False + tdSql.error(query_sql) # # and or query_sql = f'select {select_elm} from {tb_name} where c9 = true and c9 != "false" or c9 <> "binary" or c9 = "true" and c9 is not null or c9 in ("binary", true) or c9 not in ("binary")' - tdSql.query(query_sql) - tdSql.checkRows(11) - tdSql.checkEqual(self.queryLastC10(query_sql), 11) if select_elm == "*" else False + tdSql.error(query_sql) query_sql = f'select c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 from {tb_name} where c9 > "binary" and c9 >= "binary8" or c9 < "binary9" and c9 <= "binary" and c9 != 2 and c9 <> 2 and c9 = 4 or c9 is not null and c9 between 2 and 4 and c9 not between 1 and 2 and c9 in (2,4) and c9 not in (1,2)' tdSql.query(query_sql) tdSql.checkRows(9)