Merge branch '3.0' of https://github.com/taosdata/TDengine into feat/TD-21898

This commit is contained in:
liuyao 2023-11-08 19:40:59 +08:00
commit 1c4371be74
1 changed files with 9 additions and 0 deletions

View File

@ -369,6 +369,15 @@ int32_t cfgCheckRangeForDynUpdate(SConfig *pCfg, const char *name, const char *p
}
switch (pItem->dtype) {
case CFG_DTYPE_BOOL: {
int32_t ival = (int32_t)atoi(pVal);
if (ival != 0 && ival != 1) {
uError("cfg:%s, type:%s value:%d out of range[0, 1]", pItem->name,
cfgDtypeStr(pItem->dtype), ival);
terrno = TSDB_CODE_OUT_OF_RANGE;
return -1;
}
} break;
case CFG_DTYPE_INT32: {
int32_t ival = (int32_t)atoi(pVal);
if (ival < pItem->imin || ival > pItem->imax) {