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

Hotfix/sangshuduo/td 4136 taosdemo records morethan 32767 (#6147)

* [TD-4136]<fix>: taosdemo max records per req < 32767

* [TD-4136]<fix>: taosdemo check insert rows not more than 32767.

check insert rows for progressive.

* fix with answer_yes.
Co-authored-by: NShuduo Sang <sdsang@taosdata.com>
上级 71d3f4fa
......@@ -516,6 +516,8 @@ static int taosRandom()
#endif // ifdef Windows
static void prompt();
static void prompt2();
static int createDatabasesAndStables();
static void createChildTables();
static int queryDbExec(TAOS *taos, char *command, QUERY_TYPE type, bool quiet);
......@@ -1031,10 +1033,8 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
printf("# Print debug info: %d\n", arguments->debug_print);
printf("# Print verbose info: %d\n", arguments->verbose_print);
printf("###################################################################\n");
if (!arguments->answer_yes) {
printf("Press enter key to continue\n\n");
(void) getchar();
}
prompt();
}
}
......@@ -3410,10 +3410,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
g_args.interlace_rows, g_args.num_of_RPR);
printf(" interlace rows value will be set to num_of_records_per_req %"PRIu64"\n\n",
g_args.num_of_RPR);
if (!g_args.answer_yes) {
printf(" press Enter key to continue or Ctrl-C to stop.");
(void)getchar();
}
prompt2();
g_args.interlace_rows = g_args.num_of_RPR;
}
} else if (!interlaceRows) {
......@@ -3470,9 +3467,9 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
g_args.answer_yes = false;
}
} else if (!answerPrompt) {
g_args.answer_yes = false;
g_args.answer_yes = true; // default is no, mean answer_yes.
} else {
printf("ERROR: failed to read json, confirm_parameter_prompt not found\n");
errorPrint("%s", "failed to read json, confirm_parameter_prompt input mistake\n");
goto PARSE_OVER;
}
......@@ -5342,6 +5339,7 @@ static void* syncWriteProgressive(threadInfo *pThreadInfo) {
int64_t start_time = pThreadInfo->start_time;
int64_t insertRows = (superTblInfo)?superTblInfo->insertRows:g_args.num_of_DPT;
verbosePrint("%s() LN%d insertRows=%"PRId64"\n", __func__, __LINE__, insertRows);
for (uint64_t i = 0; i < insertRows;) {
......@@ -6022,6 +6020,21 @@ static void *readMetric(void *sarg) {
return NULL;
}
static void prompt()
{
if (!g_args.answer_yes) {
printf("Press enter key to continue\n\n");
(void)getchar();
}
}
static void prompt2()
{
if (!g_args.answer_yes) {
printf(" press Enter key to continue or Ctrl-C to stop.");
(void)getchar();
}
}
static int insertTestProcess() {
......@@ -6042,10 +6055,7 @@ static int insertTestProcess() {
if (g_fpOfInsertResult)
printfInsertMetaToFile(g_fpOfInsertResult);
if (!g_args.answer_yes) {
printf("Press enter key to continue\n\n");
(void)getchar();
}
prompt();
init_rand_data();
......@@ -6317,10 +6327,7 @@ static int queryTestProcess() {
&g_queryInfo.superQueryInfo.childTblCount);
}
if (!g_args.answer_yes) {
printf("Press enter key to continue\n\n");
(void)getchar();
}
prompt();
if (g_args.debug_print || g_args.verbose_print) {
printfQuerySystemInfo(taos);
......@@ -6673,10 +6680,7 @@ static int subscribeTestProcess() {
printfQueryMeta();
resetAfterAnsiEscape();
if (!g_args.answer_yes) {
printf("Press enter key to continue\n\n");
(void) getchar();
}
prompt();
TAOS * taos = NULL;
taos = taos_connect(g_queryInfo.host,
......
......@@ -27,28 +27,28 @@ class TDTestCase:
def getBuildPath(self):
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
projPath = selfPath[:selfPath.find("community")]
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
else:
projPath = selfPath[:selfPath.find("tests")]
projPath = selfPath[: selfPath.find("tests")]
for root, dirs, files in os.walk(projPath):
if ("taosd" in files):
if "taosd" in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if ("packaging" not in rootRealPath):
buildPath = root[:len(root)-len("/build/bin")]
if "packaging" not in rootRealPath:
buildPath = root[: len(root) - len("/build/bin")]
break
return buildPath
def run(self):
tdSql.prepare()
buildPath = self.getBuildPath()
if (buildPath == ""):
if buildPath == "":
tdLog.exit("taosd not found!")
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath+ "/build/bin/"
os.system("yes | %staosdemo -f tools/insert.json" % binPath)
binPath = buildPath + "/build/bin/"
os.system("%staosdemo -f tools/insert.json -y" % binPath)
tdSql.execute("use db01")
tdSql.query("select count(*) from stb01")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册