Feature/sangshuduo/td 5844 cmdline parameters align (#7852)
* [TD-5844]<feature>: make cmd line parameter similar. * fix test case align with taosdemo change. * fix windows stack overflow issue. * fix mac compile error. * fix taosdemo cmdline parameter in tests/pytest/tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py * fix windows compiler options. * make taos.exe use mysql style password input. * make taos shell and taosdump use mysql style password input. * determine scanf return value. * make console echo off during password input. * use one macro to define password length. * fix --password. change taos shell '-z' for timezone * fix password echo on darwin. * fix few lines.
This commit is contained in:
parent
c145f68a94
commit
4bff5ba73f
|
@ -125,17 +125,17 @@ enum TEST_MODE {
|
||||||
INVAID_TEST
|
INVAID_TEST
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum CREATE_SUB_TALBE_MOD_EN {
|
typedef enum CREATE_SUB_TABLE_MOD_EN {
|
||||||
PRE_CREATE_SUBTBL,
|
PRE_CREATE_SUBTBL,
|
||||||
AUTO_CREATE_SUBTBL,
|
AUTO_CREATE_SUBTBL,
|
||||||
NO_CREATE_SUBTBL
|
NO_CREATE_SUBTBL
|
||||||
} CREATE_SUB_TALBE_MOD_EN;
|
} CREATE_SUB_TABLE_MOD_EN;
|
||||||
|
|
||||||
typedef enum TALBE_EXISTS_EN {
|
typedef enum TABLE_EXISTS_EN {
|
||||||
TBL_NO_EXISTS,
|
TBL_NO_EXISTS,
|
||||||
TBL_ALREADY_EXISTS,
|
TBL_ALREADY_EXISTS,
|
||||||
TBL_EXISTS_BUTT
|
TBL_EXISTS_BUTT
|
||||||
} TALBE_EXISTS_EN;
|
} TABLE_EXISTS_EN;
|
||||||
|
|
||||||
enum enumSYNC_MODE {
|
enum enumSYNC_MODE {
|
||||||
SYNC_MODE,
|
SYNC_MODE,
|
||||||
|
@ -251,7 +251,7 @@ typedef struct SArguments_S {
|
||||||
int64_t insertRows;
|
int64_t insertRows;
|
||||||
int abort;
|
int abort;
|
||||||
uint32_t disorderRatio; // 0: no disorder, >0: x%
|
uint32_t disorderRatio; // 0: no disorder, >0: x%
|
||||||
int disorderRange; // ms, us or ns. accordig to database precision
|
int disorderRange; // ms, us or ns. according to database precision
|
||||||
uint32_t method_of_delete;
|
uint32_t method_of_delete;
|
||||||
uint64_t totalInsertRows;
|
uint64_t totalInsertRows;
|
||||||
uint64_t totalAffectedRows;
|
uint64_t totalAffectedRows;
|
||||||
|
@ -392,7 +392,7 @@ typedef struct SDbs_S {
|
||||||
} SDbs;
|
} SDbs;
|
||||||
|
|
||||||
typedef struct SpecifiedQueryInfo_S {
|
typedef struct SpecifiedQueryInfo_S {
|
||||||
uint64_t queryInterval; // 0: unlimit > 0 loop/s
|
uint64_t queryInterval; // 0: unlimited > 0 loop/s
|
||||||
uint32_t concurrent;
|
uint32_t concurrent;
|
||||||
int sqlCount;
|
int sqlCount;
|
||||||
uint32_t asyncMode; // 0: sync, 1: async
|
uint32_t asyncMode; // 0: sync, 1: async
|
||||||
|
@ -413,7 +413,7 @@ typedef struct SpecifiedQueryInfo_S {
|
||||||
|
|
||||||
typedef struct SuperQueryInfo_S {
|
typedef struct SuperQueryInfo_S {
|
||||||
char stbName[TSDB_TABLE_NAME_LEN];
|
char stbName[TSDB_TABLE_NAME_LEN];
|
||||||
uint64_t queryInterval; // 0: unlimit > 0 loop/s
|
uint64_t queryInterval; // 0: unlimited > 0 loop/s
|
||||||
uint32_t threadCnt;
|
uint32_t threadCnt;
|
||||||
uint32_t asyncMode; // 0: sync, 1: async
|
uint32_t asyncMode; // 0: sync, 1: async
|
||||||
uint64_t subscribeInterval; // ms
|
uint64_t subscribeInterval; // ms
|
||||||
|
@ -738,10 +738,10 @@ static void printVersion() {
|
||||||
char taosdemo_status[] = TAOSDEMO_STATUS;
|
char taosdemo_status[] = TAOSDEMO_STATUS;
|
||||||
|
|
||||||
if (strlen(taosdemo_status) == 0) {
|
if (strlen(taosdemo_status) == 0) {
|
||||||
printf("taosdemo verison %s-%s\n",
|
printf("taosdemo version %s-%s\n",
|
||||||
tdengine_ver, taosdemo_ver);
|
tdengine_ver, taosdemo_ver);
|
||||||
} else {
|
} else {
|
||||||
printf("taosdemo verison %s-%s, status:%s\n",
|
printf("taosdemo version %s-%s, status:%s\n",
|
||||||
tdengine_ver, taosdemo_ver, taosdemo_status);
|
tdengine_ver, taosdemo_ver, taosdemo_status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -818,7 +818,7 @@ static void printHelp() {
|
||||||
"The number of records per table. Default is 10000.");
|
"The number of records per table. Default is 10000.");
|
||||||
printf("%s%s%s%s\n", indent, "-M, --random", "\t\t\t",
|
printf("%s%s%s%s\n", indent, "-M, --random", "\t\t\t",
|
||||||
"The value of records generated are totally random.");
|
"The value of records generated are totally random.");
|
||||||
printf("%s\n", "\t\t\t\tThe default is to simulate power equipment senario.");
|
printf("%s\n", "\t\t\t\tThe default is to simulate power equipment scenario.");
|
||||||
printf("%s%s%s%s\n", indent, "-x, --no-insert", "\t\t",
|
printf("%s%s%s%s\n", indent, "-x, --no-insert", "\t\t",
|
||||||
"No-insert flag.");
|
"No-insert flag.");
|
||||||
printf("%s%s%s%s\n", indent, "-y, --answer-yes", "\t\t", "Default input yes for prompt.");
|
printf("%s%s%s%s\n", indent, "-y, --answer-yes", "\t\t", "Default input yes for prompt.");
|
||||||
|
@ -863,7 +863,7 @@ static void errorWrongValue(char *program, char *wrong_arg, char *wrong_value)
|
||||||
fprintf(stderr, "Try `taosdemo --help' or `taosdemo --usage' for more information.\n");
|
fprintf(stderr, "Try `taosdemo --help' or `taosdemo --usage' for more information.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void errorUnreconized(char *program, char *wrong_arg)
|
static void errorUnrecognized(char *program, char *wrong_arg)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: unrecognized options '%s'\n", program, wrong_arg);
|
fprintf(stderr, "%s: unrecognized options '%s'\n", program, wrong_arg);
|
||||||
fprintf(stderr, "Try `taosdemo --help' or `taosdemo --usage' for more information.\n");
|
fprintf(stderr, "Try `taosdemo --help' or `taosdemo --usage' for more information.\n");
|
||||||
|
@ -920,7 +920,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
} else if (0 == strncmp(argv[i], "--file=", strlen("--file="))) {
|
} else if (0 == strncmp(argv[i], "--file=", strlen("--file="))) {
|
||||||
arguments->metaFile = (char *)(argv[i] + strlen("--file="));
|
arguments->metaFile = (char *)(argv[i] + strlen("--file="));
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-c", strlen("-c")))
|
} else if ((0 == strncmp(argv[i], "-c", strlen("-c")))
|
||||||
|
@ -942,7 +942,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
} else if (0 == strncmp(argv[i], "--config-dir=", strlen("--config-dir="))) {
|
} else if (0 == strncmp(argv[i], "--config-dir=", strlen("--config-dir="))) {
|
||||||
tstrncpy(configDir, (char *)(argv[i] + strlen("--config-dir=")), TSDB_FILENAME_LEN);
|
tstrncpy(configDir, (char *)(argv[i] + strlen("--config-dir=")), TSDB_FILENAME_LEN);
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-h", strlen("-h")))
|
} else if ((0 == strncmp(argv[i], "-h", strlen("-h")))
|
||||||
|
@ -964,7 +964,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
} else if (0 == strncmp(argv[i], "--host=", strlen("--host="))) {
|
} else if (0 == strncmp(argv[i], "--host=", strlen("--host="))) {
|
||||||
arguments->host = (char *)(argv[i] + strlen("--host="));
|
arguments->host = (char *)(argv[i] + strlen("--host="));
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if (strcmp(argv[i], "-PP") == 0) {
|
} else if (strcmp(argv[i], "-PP") == 0) {
|
||||||
|
@ -998,7 +998,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->port = atoi(argv[++i]);
|
arguments->port = atoi(argv[++i]);
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-I", strlen("-I")))
|
} else if ((0 == strncmp(argv[i], "-I", strlen("-I")))
|
||||||
|
@ -1059,7 +1059,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-u", strlen("-u")))
|
} else if ((0 == strncmp(argv[i], "-u", strlen("-u")))
|
||||||
|
@ -1081,7 +1081,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->user = argv[++i];
|
arguments->user = argv[++i];
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-p", strlen("-p")))
|
} else if ((0 == strncmp(argv[i], "-p", strlen("-p")))
|
||||||
|
@ -1115,7 +1115,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->output_file = argv[++i];
|
arguments->output_file = argv[++i];
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-s", strlen("-s")))
|
} else if ((0 == strncmp(argv[i], "-s", strlen("-s")))
|
||||||
|
@ -1137,7 +1137,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->sqlFile = argv[++i];
|
arguments->sqlFile = argv[++i];
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-q", strlen("-q")))
|
} else if ((0 == strncmp(argv[i], "-q", strlen("-q")))
|
||||||
|
@ -1175,7 +1175,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->async_mode = atoi(argv[++i]);
|
arguments->async_mode = atoi(argv[++i]);
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-T", strlen("-T")))
|
} else if ((0 == strncmp(argv[i], "-T", strlen("-T")))
|
||||||
|
@ -1213,7 +1213,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->nthreads = atoi(argv[++i]);
|
arguments->nthreads = atoi(argv[++i]);
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-i", strlen("-i")))
|
} else if ((0 == strncmp(argv[i], "-i", strlen("-i")))
|
||||||
|
@ -1251,7 +1251,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->insert_interval = atoi(argv[++i]);
|
arguments->insert_interval = atoi(argv[++i]);
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-S", strlen("-S")))
|
} else if ((0 == strncmp(argv[i], "-S", strlen("-S")))
|
||||||
|
@ -1289,7 +1289,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->async_mode = atoi(argv[++i]);
|
arguments->async_mode = atoi(argv[++i]);
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if (strcmp(argv[i], "-qt") == 0) {
|
} else if (strcmp(argv[i], "-qt") == 0) {
|
||||||
|
@ -1335,7 +1335,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->interlace_rows = atoi(argv[++i]);
|
arguments->interlace_rows = atoi(argv[++i]);
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-r", strlen("-r")))
|
} else if ((0 == strncmp(argv[i], "-r", strlen("-r")))
|
||||||
|
@ -1373,7 +1373,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->reqPerReq = atoi(argv[++i]);
|
arguments->reqPerReq = atoi(argv[++i]);
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-t", strlen("-t")))
|
} else if ((0 == strncmp(argv[i], "-t", strlen("-t")))
|
||||||
|
@ -1411,7 +1411,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->ntables = atoi(argv[++i]);
|
arguments->ntables = atoi(argv[++i]);
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1451,7 +1451,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->insertRows = atoi(argv[++i]);
|
arguments->insertRows = atoi(argv[++i]);
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-d", strlen("-d")))
|
} else if ((0 == strncmp(argv[i], "-d", strlen("-d")))
|
||||||
|
@ -1473,7 +1473,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->database = argv[++i];
|
arguments->database = argv[++i];
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-l", strlen("-l")))
|
} else if ((0 == strncmp(argv[i], "-l", strlen("-l")))
|
||||||
|
@ -1512,12 +1512,12 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->columnCount = atoi(argv[++i]);
|
arguments->columnCount = atoi(argv[++i]);
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments->columnCount > MAX_NUM_COLUMNS) {
|
if (arguments->columnCount > MAX_NUM_COLUMNS) {
|
||||||
printf("WARNING: max acceptible columns count is %d\n", MAX_NUM_COLUMNS);
|
printf("WARNING: max acceptable columns count is %d\n", MAX_NUM_COLUMNS);
|
||||||
prompt();
|
prompt();
|
||||||
arguments->columnCount = MAX_NUM_COLUMNS;
|
arguments->columnCount = MAX_NUM_COLUMNS;
|
||||||
}
|
}
|
||||||
|
@ -1552,7 +1552,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
dataType = argv[++i];
|
dataType = argv[++i];
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1687,7 +1687,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->binwidth = atoi(argv[++i]);
|
arguments->binwidth = atoi(argv[++i]);
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-m", strlen("-m")))
|
} else if ((0 == strncmp(argv[i], "-m", strlen("-m")))
|
||||||
|
@ -1709,7 +1709,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->tb_prefix = argv[++i];
|
arguments->tb_prefix = argv[++i];
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((strcmp(argv[i], "-N") == 0)
|
} else if ((strcmp(argv[i], "-N") == 0)
|
||||||
|
@ -1774,7 +1774,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->disorderRange = atoi(argv[++i]);
|
arguments->disorderRange = atoi(argv[++i]);
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((0 == strncmp(argv[i], "-O", strlen("-O")))
|
} else if ((0 == strncmp(argv[i], "-O", strlen("-O")))
|
||||||
|
@ -1812,7 +1812,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->disorderRatio = atoi(argv[++i]);
|
arguments->disorderRatio = atoi(argv[++i]);
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1866,7 +1866,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
}
|
}
|
||||||
arguments->replica = atoi(argv[++i]);
|
arguments->replica = atoi(argv[++i]);
|
||||||
} else {
|
} else {
|
||||||
errorUnreconized(argv[0], argv[i]);
|
errorUnrecognized(argv[0], argv[i]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1878,7 +1878,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
} else if (strcmp(argv[i], "-D") == 0) {
|
} else if (strcmp(argv[i], "-D") == 0) {
|
||||||
arguments->method_of_delete = atoi(argv[++i]);
|
arguments->method_of_delete = atoi(argv[++i]);
|
||||||
if (arguments->method_of_delete > 3) {
|
if (arguments->method_of_delete > 3) {
|
||||||
errorPrint("%s", "\n\t-D need a valud (0~3) number following!\n");
|
errorPrint("%s", "\n\t-D need a value (0~3) number following!\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if ((strcmp(argv[i], "--version") == 0)
|
} else if ((strcmp(argv[i], "--version") == 0)
|
||||||
|
@ -1893,7 +1893,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
printf(" Usage: taosdemo [-f JSONFILE] [-u USER] [-p PASSWORD] [-c CONFIG_DIR]\n\
|
printf(" Usage: taosdemo [-f JSONFILE] [-u USER] [-p PASSWORD] [-c CONFIG_DIR]\n\
|
||||||
[-h HOST] [-P PORT] [-I INTERFACE] [-d DATABASE] [-a REPLICA]\n\
|
[-h HOST] [-P PORT] [-I INTERFACE] [-d DATABASE] [-a REPLICA]\n\
|
||||||
[-m TABLEPREFIX] [-s SQLFILE] [-N] [-o OUTPUTFILE] [-q QUERYMODE]\n\
|
[-m TABLEPREFIX] [-s SQLFILE] [-N] [-o OUTPUTFILE] [-q QUERYMODE]\n\
|
||||||
[-b DATATYPES] [-w WIDTH_OF_BINARY] [-l COLUNNS] [-T THREADNUMBER]\n\
|
[-b DATATYPES] [-w WIDTH_OF_BINARY] [-l COLUMNS] [-T THREADNUMBER]\n\
|
||||||
[-i SLEEPTIME] [-S TIME_STEP] [-B INTERLACE_ROWS] [-t TABLES]\n\
|
[-i SLEEPTIME] [-S TIME_STEP] [-B INTERLACE_ROWS] [-t TABLES]\n\
|
||||||
[-n RECORDS] [-M] [-x] [-y] [-O ORDERMODE] [-R RANGE] [-a REPLIcA][-g]\n\
|
[-n RECORDS] [-M] [-x] [-y] [-O ORDERMODE] [-R RANGE] [-a REPLIcA][-g]\n\
|
||||||
[--help] [--usage] [--version]\n");
|
[--help] [--usage] [--version]\n");
|
||||||
|
@ -2466,9 +2466,9 @@ static int printfInsertMeta() {
|
||||||
printf(" database[%d] name: \033[33m%s\033[0m\n",
|
printf(" database[%d] name: \033[33m%s\033[0m\n",
|
||||||
i, g_Dbs.db[i].dbName);
|
i, g_Dbs.db[i].dbName);
|
||||||
if (0 == g_Dbs.db[i].drop) {
|
if (0 == g_Dbs.db[i].drop) {
|
||||||
printf(" drop: \033[33mno\033[0m\n");
|
printf(" drop: \033[33m no\033[0m\n");
|
||||||
} else {
|
} else {
|
||||||
printf(" drop: \033[33myes\033[0m\n");
|
printf(" drop: \033[33m yes\033[0m\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_Dbs.db[i].dbCfg.blocks > 0) {
|
if (g_Dbs.db[i].dbCfg.blocks > 0) {
|
||||||
|
@ -2577,9 +2577,9 @@ static int printfInsertMeta() {
|
||||||
g_Dbs.db[i].superTbls[j].insertRows);
|
g_Dbs.db[i].superTbls[j].insertRows);
|
||||||
/*
|
/*
|
||||||
if (0 == g_Dbs.db[i].superTbls[j].multiThreadWriteOneTbl) {
|
if (0 == g_Dbs.db[i].superTbls[j].multiThreadWriteOneTbl) {
|
||||||
printf(" multiThreadWriteOneTbl: \033[33mno\033[0m\n");
|
printf(" multiThreadWriteOneTbl: \033[33m no\033[0m\n");
|
||||||
}else {
|
}else {
|
||||||
printf(" multiThreadWriteOneTbl: \033[33myes\033[0m\n");
|
printf(" multiThreadWriteOneTbl: \033[33m yes\033[0m\n");
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
printf(" interlaceRows: \033[33m%u\033[0m\n",
|
printf(" interlaceRows: \033[33m%u\033[0m\n",
|
||||||
|
@ -5137,7 +5137,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
|
||||||
goto PARSE_OVER;
|
goto PARSE_OVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
// super_talbes
|
// super_tables
|
||||||
cJSON *stables = cJSON_GetObjectItem(dbinfos, "super_tables");
|
cJSON *stables = cJSON_GetObjectItem(dbinfos, "super_tables");
|
||||||
if (!stables || stables->type != cJSON_Array) {
|
if (!stables || stables->type != cJSON_Array) {
|
||||||
errorPrint("%s", "failed to read json, super_tables not found\n");
|
errorPrint("%s", "failed to read json, super_tables not found\n");
|
||||||
|
@ -5474,7 +5474,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
|
||||||
goto PARSE_OVER;
|
goto PARSE_OVER;
|
||||||
}
|
}
|
||||||
} else if (!insertInterval) {
|
} else if (!insertInterval) {
|
||||||
verbosePrint("%s() LN%d: stable insert interval be overrided by global %"PRIu64".\n",
|
verbosePrint("%s() LN%d: stable insert interval be overrode by global %"PRIu64".\n",
|
||||||
__func__, __LINE__, g_args.insert_interval);
|
__func__, __LINE__, g_args.insert_interval);
|
||||||
g_Dbs.db[i].superTbls[j].insertInterval = g_args.insert_interval;
|
g_Dbs.db[i].superTbls[j].insertInterval = g_args.insert_interval;
|
||||||
} else {
|
} else {
|
||||||
|
@ -9534,7 +9534,7 @@ static void *readTable(void *sarg) {
|
||||||
insertRows = g_args.insertRows;
|
insertRows = g_args.insertRows;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
int64_t ntables = pThreadInfo->ntables; // rinfo->end_table_to - rinfo->start_table_from + 1;
|
int64_t ntables = pThreadInfo->ntables; // pThreadInfo->end_table_to - pThreadInfo->start_table_from + 1;
|
||||||
int64_t totalData = insertRows * ntables;
|
int64_t totalData = insertRows * ntables;
|
||||||
bool do_aggreFunc = g_Dbs.do_aggreFunc;
|
bool do_aggreFunc = g_Dbs.do_aggreFunc;
|
||||||
|
|
||||||
|
@ -9603,7 +9603,7 @@ static void *readMetric(void *sarg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t insertRows = pThreadInfo->stbInfo->insertRows;
|
int64_t insertRows = pThreadInfo->stbInfo->insertRows;
|
||||||
int64_t ntables = pThreadInfo->ntables; // rinfo->end_table_to - rinfo->start_table_from + 1;
|
int64_t ntables = pThreadInfo->ntables; // pThreadInfo->end_table_to - pThreadInfo->start_table_from + 1;
|
||||||
int64_t totalData = insertRows * ntables;
|
int64_t totalData = insertRows * ntables;
|
||||||
bool do_aggreFunc = g_Dbs.do_aggreFunc;
|
bool do_aggreFunc = g_Dbs.do_aggreFunc;
|
||||||
|
|
||||||
|
@ -9709,7 +9709,7 @@ static int insertTestProcess() {
|
||||||
}
|
}
|
||||||
free(cmdBuffer);
|
free(cmdBuffer);
|
||||||
|
|
||||||
// pretreatement
|
// pretreatment
|
||||||
if (prepareSampleData() != 0) {
|
if (prepareSampleData() != 0) {
|
||||||
if (g_fpOfInsertResult)
|
if (g_fpOfInsertResult)
|
||||||
fclose(g_fpOfInsertResult);
|
fclose(g_fpOfInsertResult);
|
||||||
|
@ -10141,7 +10141,7 @@ static void stable_sub_callback(
|
||||||
|
|
||||||
if (param)
|
if (param)
|
||||||
fetchResult(res, (threadInfo *)param);
|
fetchResult(res, (threadInfo *)param);
|
||||||
// tao_unscribe() will free result.
|
// tao_unsubscribe() will free result.
|
||||||
}
|
}
|
||||||
|
|
||||||
static void specified_sub_callback(
|
static void specified_sub_callback(
|
||||||
|
@ -10154,7 +10154,7 @@ static void specified_sub_callback(
|
||||||
|
|
||||||
if (param)
|
if (param)
|
||||||
fetchResult(res, (threadInfo *)param);
|
fetchResult(res, (threadInfo *)param);
|
||||||
// tao_unscribe() will free result.
|
// tao_unsubscribe() will free result.
|
||||||
}
|
}
|
||||||
|
|
||||||
static TAOS_SUB* subscribeImpl(
|
static TAOS_SUB* subscribeImpl(
|
||||||
|
@ -10494,12 +10494,12 @@ static int subscribeTestProcess() {
|
||||||
|
|
||||||
//==== create threads for query for specified table
|
//==== create threads for query for specified table
|
||||||
if (g_queryInfo.specifiedQueryInfo.sqlCount <= 0) {
|
if (g_queryInfo.specifiedQueryInfo.sqlCount <= 0) {
|
||||||
debugPrint("%s() LN%d, sepcified query sqlCount %d.\n",
|
debugPrint("%s() LN%d, specified query sqlCount %d.\n",
|
||||||
__func__, __LINE__,
|
__func__, __LINE__,
|
||||||
g_queryInfo.specifiedQueryInfo.sqlCount);
|
g_queryInfo.specifiedQueryInfo.sqlCount);
|
||||||
} else {
|
} else {
|
||||||
if (g_queryInfo.specifiedQueryInfo.concurrent <= 0) {
|
if (g_queryInfo.specifiedQueryInfo.concurrent <= 0) {
|
||||||
errorPrint2("%s() LN%d, sepcified query sqlCount %d.\n",
|
errorPrint2("%s() LN%d, specified query sqlCount %d.\n",
|
||||||
__func__, __LINE__,
|
__func__, __LINE__,
|
||||||
g_queryInfo.specifiedQueryInfo.sqlCount);
|
g_queryInfo.specifiedQueryInfo.sqlCount);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|
|
@ -1209,14 +1209,14 @@ _dump_db_point:
|
||||||
|
|
||||||
fprintf(fp, "USE %s;\n\n", g_dbInfos[0]->name);
|
fprintf(fp, "USE %s;\n\n", g_dbInfos[0]->name);
|
||||||
|
|
||||||
int32_t totalNumOfThread = 1; // 0: all normal talbe into .tables.tmp.0
|
int32_t totalNumOfThread = 1; // 0: all normal table into .tables.tmp.0
|
||||||
int normalTblFd = -1;
|
int normalTblFd = -1;
|
||||||
int32_t retCode;
|
int32_t retCode;
|
||||||
int superTblCnt = 0 ;
|
int superTblCnt = 0 ;
|
||||||
for (int i = 1; g_args.arg_list[i]; i++) {
|
for (int i = 1; g_args.arg_list[i]; i++) {
|
||||||
if (taosGetTableRecordInfo(g_args.arg_list[i],
|
if (taosGetTableRecordInfo(g_args.arg_list[i],
|
||||||
&tableRecordInfo, taos) < 0) {
|
&tableRecordInfo, taos) < 0) {
|
||||||
errorPrint("input the invalide table %s\n",
|
errorPrint("input the invalid table %s\n",
|
||||||
g_args.arg_list[i]);
|
g_args.arg_list[i]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1341,11 +1341,10 @@ static int taosGetTableDes(
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if chidl-table have tag, using select tagName from table to get tagValue
|
// if child-table have tag, using select tagName from table to get tagValue
|
||||||
for (int i = 0 ; i < count; i++) {
|
for (int i = 0 ; i < count; i++) {
|
||||||
if (strcmp(stableDes->cols[i].note, "TAG") != 0) continue;
|
if (strcmp(stableDes->cols[i].note, "TAG") != 0) continue;
|
||||||
|
|
||||||
|
|
||||||
sprintf(sqlstr, "select %s from %s.%s",
|
sprintf(sqlstr, "select %s from %s.%s",
|
||||||
stableDes->cols[i].field, dbName, table);
|
stableDes->cols[i].field, dbName, table);
|
||||||
|
|
||||||
|
@ -2443,7 +2442,7 @@ static int taosGetFilesNum(const char *directoryName,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fileNum <= 0) {
|
if (fileNum <= 0) {
|
||||||
errorPrint("directory:%s is empry\n", directoryName);
|
errorPrint("directory:%s is empty\n", directoryName);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2620,9 +2619,9 @@ static int taosDumpInOneFile(TAOS* taos, FILE* fp, char* fcharset,
|
||||||
memcpy(cmd + cmd_len, line, read_len);
|
memcpy(cmd + cmd_len, line, read_len);
|
||||||
cmd[read_len + cmd_len]= '\0';
|
cmd[read_len + cmd_len]= '\0';
|
||||||
if (queryDbImpl(taos, cmd)) {
|
if (queryDbImpl(taos, cmd)) {
|
||||||
errorPrint("%s() LN%d, error sql: linenu:%d, file:%s\n",
|
errorPrint("%s() LN%d, error sql: lineno:%d, file:%s\n",
|
||||||
__func__, __LINE__, lineNo, fileName);
|
__func__, __LINE__, lineNo, fileName);
|
||||||
fprintf(g_fpOfResult, "error sql: linenu:%d, file:%s\n", lineNo, fileName);
|
fprintf(g_fpOfResult, "error sql: lineno:%d, file:%s\n", lineNo, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(cmd, 0, TSDB_MAX_ALLOWED_SQL_LEN);
|
memset(cmd, 0, TSDB_MAX_ALLOWED_SQL_LEN);
|
||||||
|
|
Loading…
Reference in New Issue