diff --git a/packaging/cfg/taos.cfg b/packaging/cfg/taos.cfg index 0e28d8b43c8e205fe9d4aea20d40d16cc85f986a..3ae4e9941e96abb4c93b99ae86c40b3e3583bd08 100644 --- a/packaging/cfg/taos.cfg +++ b/packaging/cfg/taos.cfg @@ -144,8 +144,8 @@ keepColumnName 1 # max length of an SQL # maxSQLLength 65480 -# max length of like -# maxLikeLength 100 +# max length of WildCards +# maxWildCardsLength 100 # the maximum number of records allowed for super table time sorting # maxNumOfOrderedRes 100000 diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 8bab4225b81335c3666f8f65f7ca82e27ae39695..573e8b8782de02d5361ad840d517ece75544df52 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -4401,9 +4401,9 @@ static int32_t validateLikeExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t tSqlExpr* pRight = pExpr->pRight; if (pExpr->tokenId == TK_LIKE) { - if (pRight->value.nLen > tsMaxLikeStringLen) { + if (pRight->value.nLen > tsMaxWildCardsLen) { char tmp[64] = {0}; - sprintf(tmp, msg1, tsMaxLikeStringLen); + sprintf(tmp, msg1, tsMaxWildCardsLen); return invalidOperationMsg(msgBuf, tmp); } diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h index 544482fd1499c24b7ed3151bd9397a0400424ea4..25d1c90ec543f28ebc4ed3687b0efe064de09941 100644 --- a/src/common/inc/tglobal.h +++ b/src/common/inc/tglobal.h @@ -70,7 +70,7 @@ extern int8_t tsKeepOriginalColumnName; // client extern int32_t tsMaxSQLStringLen; -extern int32_t tsMaxLikeStringLen; +extern int32_t tsMaxWildCardsLen; extern int8_t tsTscEnableRecordSql; extern int32_t tsMaxNumOfOrderedResults; extern int32_t tsMinSlidingTime; diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index 98d524179d04c896b668ac883fc91f67dd318ab7..3c904dc03473015179bff37921c2f4381f68c1bb 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -76,7 +76,7 @@ int32_t tsCompressMsgSize = -1; // client int32_t tsMaxSQLStringLen = TSDB_MAX_ALLOWED_SQL_LEN; -int32_t tsMaxLikeStringLen = TSDB_PATTERN_STRING_MAX_LEN; +int32_t tsMaxWildCardsLen = TSDB_PATTERN_STRING_MAX_LEN; int8_t tsTscEnableRecordSql = 0; // the maximum number of results for projection query on super table that are returned from @@ -986,8 +986,8 @@ static void doInitGlobalConfig(void) { cfg.unitType = TAOS_CFG_UTYPE_BYTE; taosInitConfigOption(cfg); - cfg.option = "maxLikeLength"; - cfg.ptr = &tsMaxLikeStringLen; + cfg.option = "maxWildCardsLength"; + cfg.ptr = &tsMaxWildCardsLen; cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT | TSDB_CFG_CTYPE_B_SHOW; cfg.minValue = 0;