Skip to content

Commit

Permalink
Merge pull request #745 from taosdata/fix/TS-4881
Browse files Browse the repository at this point in the history
check childtable_from and childtable_to valid
  • Loading branch information
DuanKuanJun committed May 30, 2024
2 parents e754cc6 + 934ff88 commit 0806e0c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/benchJsonOpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,13 +930,23 @@ static int getStableInfo(tools_cJSON *dbinfos, int index) {
if (tools_cJSON_IsNumber(childTbl_to)) {
superTable->childTblTo = childTbl_to->valueint;
if (superTable->childTblTo < superTable->childTblFrom) {
errorPrint("child table _to_ is invalid number,"
errorPrint("json config invalid. child table _to_ is invalid number,"
"%"PRId64" < %"PRId64"\n",
superTable->childTblTo, superTable->childTblFrom);
return -1;
}
}

// check childtable_from and childtable_to valid
if (superTable->childTblFrom >= superTable->childTblCount) {
errorPrint("json config invalid. childtable_from(%"PRId64") is equal or large than childtable_count(%"PRId64")\n", superTable->childTblFrom, superTable->childTblCount);
return -1;
}
if (superTable->childTblTo > superTable->childTblCount) {
errorPrint("json config invalid. childtable_to(%"PRId64") is large than childtable_count(%"PRId64")\n", superTable->childTblTo, superTable->childTblCount);
return -1;
}

tools_cJSON *continueIfFail =
tools_cJSON_GetObjectItem(stbInfo, "continue_if_fail"); // yes, no,
if (tools_cJSON_IsString(continueIfFail)) {
Expand Down

0 comments on commit 0806e0c

Please sign in to comment.