Skip to content

Commit

Permalink
fix: from and to argument valid
Browse files Browse the repository at this point in the history
  • Loading branch information
DuanKuanJun committed Jun 1, 2024
1 parent c0d63d9 commit 91f1286
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
13 changes: 4 additions & 9 deletions src/benchInsert.c
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ static int startMultiThreadCreateChildTable(SDataBase* database, SSuperTable* st
int32_t threads = g_arguments->table_threads;
int64_t ntables;
if (stbInfo->childTblTo > 0) {
ntables = stbInfo->childTblTo - stbInfo->childTblFrom + 1;
ntables = stbInfo->childTblTo - stbInfo->childTblFrom;
} else if(stbInfo->childTblFrom > 0) {
ntables = stbInfo->childTblCount - stbInfo->childTblFrom;
} else {
Expand Down Expand Up @@ -1604,10 +1604,7 @@ static void *syncWriteInterlace(void *sarg) {
if (g_arguments->bind_vgroup) {
childTbl = pThreadInfo->vg->childTblArray[tableSeq];
} else {
childTbl = stbInfo->childTblArray[
stbInfo->childTblExists?
tableSeq:
stbInfo->childTblFrom + tableSeq];
childTbl = stbInfo->childTblArray[tableSeq];
}

char * tableName = childTbl->name;
Expand Down Expand Up @@ -2437,11 +2434,9 @@ void *syncWriteProgressive(void *sarg) {
if (g_arguments->bind_vgroup) {
childTbl = pThreadInfo->vg->childTblArray[tableSeq];
} else {
childTbl = stbInfo->childTblArray[
stbInfo->childTblExists?
tableSeq:
stbInfo->childTblFrom + tableSeq];
childTbl = stbInfo->childTblArray[tableSeq];
}
debugPrint("tableSeq=%"PRId64" childTbl->name=%s\n", tableSeq, childTbl->name);

if (childTbl->useOwnSample) {
sampleDataBuf = childTbl->sampleDataBuf;
Expand Down
4 changes: 2 additions & 2 deletions src/benchInsertMix.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,6 @@ bool checkCorrect(threadInfo* info, SDataBase* db, SSuperTable* stb, char* tbNam
//
bool insertDataMix(threadInfo* info, SDataBase* db, SSuperTable* stb) {
int64_t lastPrintTime = 0;
infoPrint("insert mode is mix. generate_row_rule=%d\n", stb->genRowRule);

// check interface
if (stb->iface != TAOSC_IFACE) {
return false;
Expand All @@ -778,6 +776,8 @@ bool insertDataMix(threadInfo* info, SDataBase* db, SSuperTable* stb) {
return false;
}

infoPrint("insert mode is mix. generate_row_rule=%d\n", stb->genRowRule);

FILE* csvFile = NULL;
char* tagData = NULL;
bool acreate = (stb->genRowRule == RULE_OLD || stb->genRowRule == RULE_MIX_RANDOM) && stb->autoTblCreating;
Expand Down

0 comments on commit 91f1286

Please sign in to comment.