未验证 提交 dfdeb7e0 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

[TD-3431] <fix>: fix taosdemo cmdline incorrect arguments. (#5536)

Co-authored-by: NShuduo Sang <sdsang@taosdata.com>
上级 38a8cb7a
...@@ -523,8 +523,8 @@ SArguments g_args = { ...@@ -523,8 +523,8 @@ SArguments g_args = {
1, // replica 1, // replica
"t", // tb_prefix "t", // tb_prefix
NULL, // sqlFile NULL, // sqlFile
false, // use_metric true, // use_metric
false, // insert_only true, // insert_only
false, // debug_print false, // debug_print
false, // verbose_print false, // verbose_print
false, // performance statistic print false, // performance statistic print
...@@ -614,7 +614,7 @@ static void printHelp() { ...@@ -614,7 +614,7 @@ static void printHelp() {
printf("%s%s%s%s\n", indent, "-m", indent, printf("%s%s%s%s\n", indent, "-m", indent,
"Table prefix name. Default is 't'."); "Table prefix name. Default is 't'.");
printf("%s%s%s%s\n", indent, "-s", indent, "The select sql file."); printf("%s%s%s%s\n", indent, "-s", indent, "The select sql file.");
printf("%s%s%s%s\n", indent, "-M", indent, "Use metric flag."); printf("%s%s%s%s\n", indent, "-N", indent, "Use normal table flag.");
printf("%s%s%s%s\n", indent, "-o", indent, printf("%s%s%s%s\n", indent, "-o", indent,
"Direct output to the named file. Default is './output.txt'."); "Direct output to the named file. Default is './output.txt'.");
printf("%s%s%s%s\n", indent, "-q", indent, printf("%s%s%s%s\n", indent, "-q", indent,
...@@ -742,10 +742,10 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) { ...@@ -742,10 +742,10 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
arguments->len_of_binary = atoi(argv[++i]); arguments->len_of_binary = atoi(argv[++i]);
} else if (strcmp(argv[i], "-m") == 0) { } else if (strcmp(argv[i], "-m") == 0) {
arguments->tb_prefix = argv[++i]; arguments->tb_prefix = argv[++i];
} else if (strcmp(argv[i], "-M") == 0) { } else if (strcmp(argv[i], "-N") == 0) {
arguments->use_metric = true; arguments->use_metric = false;
} else if (strcmp(argv[i], "-x") == 0) { } else if (strcmp(argv[i], "-x") == 0) {
arguments->insert_only = true; arguments->insert_only = false;
} else if (strcmp(argv[i], "-y") == 0) { } else if (strcmp(argv[i], "-y") == 0) {
arguments->answer_yes = true; arguments->answer_yes = true;
} else if (strcmp(argv[i], "-g") == 0) { } else if (strcmp(argv[i], "-g") == 0) {
...@@ -2576,7 +2576,7 @@ static int startMultiThreadCreateChildTable( ...@@ -2576,7 +2576,7 @@ static int startMultiThreadCreateChildTable(
t_info->ntables = i<b?a+1:a; t_info->ntables = i<b?a+1:a;
t_info->end_table_to = i < b ? startFrom + a : startFrom + a - 1; t_info->end_table_to = i < b ? startFrom + a : startFrom + a - 1;
startFrom = t_info->end_table_to + 1; startFrom = t_info->end_table_to + 1;
t_info->use_metric = 1; t_info->use_metric = true;
t_info->cols = cols; t_info->cols = cols;
t_info->minDelay = INT16_MAX; t_info->minDelay = INT16_MAX;
pthread_create(pids + i, NULL, createTable, t_info); pthread_create(pids + i, NULL, createTable, t_info);
...@@ -2597,7 +2597,6 @@ static int startMultiThreadCreateChildTable( ...@@ -2597,7 +2597,6 @@ static int startMultiThreadCreateChildTable(
return 0; return 0;
} }
static void createChildTables() { static void createChildTables() {
char tblColsBuf[MAX_SQL_SIZE]; char tblColsBuf[MAX_SQL_SIZE];
int len; int len;
......
...@@ -51,7 +51,7 @@ class TDTestCase: ...@@ -51,7 +51,7 @@ class TDTestCase:
else: else:
tdLog.info("taosd found in %s" % buildPath) tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath + "/build/bin/" binPath = buildPath + "/build/bin/"
os.system("%staosdemo -y -M -t %d -n %d -x" % os.system("%staosdemo -y -t %d -n %d" %
(binPath, self.numberOfTables, self.numberOfRecords)) (binPath, self.numberOfTables, self.numberOfRecords))
tdSql.execute("use test") tdSql.execute("use test")
......
...@@ -31,7 +31,7 @@ class TDTestCase: ...@@ -31,7 +31,7 @@ class TDTestCase:
def insertDataAndAlterTable(self, threadID): def insertDataAndAlterTable(self, threadID):
if(threadID == 0): if(threadID == 0):
os.system("taosdemo -M -y -t %d -n %d -x" % os.system("taosdemo -y -t %d -n %d" %
(self.numberOfTables, self.numberOfRecords)) (self.numberOfTables, self.numberOfRecords))
if(threadID == 1): if(threadID == 1):
time.sleep(2) time.sleep(2)
......
...@@ -50,7 +50,7 @@ class TDTestCase: ...@@ -50,7 +50,7 @@ class TDTestCase:
else: else:
tdLog.info("taosd found in %s" % buildPath) tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath + "/build/bin/" binPath = buildPath + "/build/bin/"
os.system("%staosdemo -y -t %d -n %d -x" % os.system("%staosdemo -N -y -t %d -n %d" %
(binPath, self.numberOfTables, self.numberOfRecords)) (binPath, self.numberOfTables, self.numberOfRecords))
tdSql.query("show databases") tdSql.query("show databases")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册