提交 7bd970f0 编写于 作者: wmmhello's avatar wmmhello

[TD-5939]<fix> fix long where condition error. add length limit

上级 eb80f2ff
......@@ -3994,7 +3994,13 @@ static int32_t getColQueryCondExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSqlEx
UNUSED(code);
// TODO: more error handling
} END_TRY
if (tbufTell(&bw) >= TSDB_MAX_WHERE_LEN ) {
char tmp[64] = {0};
sprintf(tmp, "where condition string should be less than %d characters", TSDB_MAX_WHERE_LEN);
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), tmp);
}
// add to required table column list
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, i);
int64_t uid = pTableMetaInfo->pTableMeta->id.uid;
......@@ -5238,7 +5244,13 @@ static int32_t getTagQueryCondExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SCondE
UNUSED(code);
// TODO: more error handling
} END_TRY
if (tbufTell(&bw) >= TSDB_MAX_WHERE_LEN ) {
char tmp[64] = {0};
sprintf(tmp, "where condition string should be less than %d characters", TSDB_MAX_WHERE_LEN);
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), tmp);
}
// add to required table column list
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, i);
int64_t uid = pTableMetaInfo->pTableMeta->id.uid;
......
......@@ -210,6 +210,7 @@ do { \
#define TSDB_MAX_TAGS_LEN 16384
#define TSDB_MAX_TAGS 128
#define TSDB_MAX_TAG_CONDITIONS 1024
#define TSDB_MAX_WHERE_LEN 65535
#define TSDB_AUTH_LEN 16
#define TSDB_KEY_LEN 16
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册