未验证 提交 b5000e62 编写于 作者: Y Yang Zhao 提交者: GitHub

[TD-10881]<fix>taosdemo -x Segmentation fault(master) (#8610)

* [TD-10881]<fix>taosdemo -x Segmentation fault

* fix param parse
上级 99f9e504
......@@ -1303,7 +1303,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
errorPrintReqArg2(argv[0], "S");
exit(EXIT_FAILURE);
}
arguments->async_mode = atoi(argv[++i]);
arguments->timestamp_step = atoi(argv[++i]);
} else if (0 == strncmp(argv[i], "--time-step=", strlen("--time-step="))) {
if (isStringNumber((char *)(argv[i] + strlen("--time-step=")))) {
arguments->async_mode = atoi((char *)(argv[i]+strlen("--time-step=")));
......@@ -1313,7 +1313,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
}
} else if (0 == strncmp(argv[i], "-S", strlen("-S"))) {
if (isStringNumber((char *)(argv[i] + strlen("-S")))) {
arguments->async_mode = atoi((char *)(argv[i]+strlen("-S")));
arguments->timestamp_step = atoi((char *)(argv[i]+strlen("-S")));
} else {
errorPrintReqArg2(argv[0], "-S");
exit(EXIT_FAILURE);
......@@ -1326,7 +1326,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
errorPrintReqArg2(argv[0], "--time-step");
exit(EXIT_FAILURE);
}
arguments->async_mode = atoi(argv[++i]);
arguments->timestamp_step = atoi(argv[++i]);
} else {
errorUnrecognized(argv[0], argv[i]);
exit(EXIT_FAILURE);
......@@ -11039,7 +11039,6 @@ static int insertTestProcess() {
// totalAffectedRows += g_Dbs.db[i].superTbls[j].totalAffectedRows;
//}
//printf("Spent %.4f seconds to insert rows: %"PRId64", affected rows: %"PRId64" with %d thread(s)\n\n", end - start, totalInsertRows, totalAffectedRows, g_Dbs.threadCount);
postFreeResource();
return 0;
}
......@@ -12240,6 +12239,7 @@ static void testCmdLine() {
if (g_Dbs.aggr_func) {
queryAggrFunc();
}
postFreeResource();
}
int main(int argc, char *argv[]) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册