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

Hotfix/sangshuduo/td 4136 taosdemo records morethan 32767 for develop (#6175)

* [TD-4136]<fix>: taosdemo records per req more than 32767.

for develop branch.

* change taosRandom() to rand_bool() for bool data.

* [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>
上级 243a3d16
...@@ -1088,10 +1088,8 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) { ...@@ -1088,10 +1088,8 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
printf("# Print debug info: %d\n", arguments->debug_print); printf("# Print debug info: %d\n", arguments->debug_print);
printf("# Print verbose info: %d\n", arguments->verbose_print); printf("# Print verbose info: %d\n", arguments->verbose_print);
printf("###################################################################\n"); printf("###################################################################\n");
if (!arguments->answer_yes) {
printf("Press enter key to continue\n\n"); prompt();
(void) getchar();
}
} }
} }
...@@ -3513,6 +3511,11 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { ...@@ -3513,6 +3511,11 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
__func__, __LINE__); __func__, __LINE__);
goto PARSE_OVER; goto PARSE_OVER;
} else if (numRecPerReq->valueint > MAX_RECORDS_PER_REQ) { } else if (numRecPerReq->valueint > MAX_RECORDS_PER_REQ) {
printf("NOTICE: number of records per request value %"PRIu64" > %d\n\n",
numRecPerReq->valueint, MAX_RECORDS_PER_REQ);
printf(" number of records per request value will be set to %d\n\n",
MAX_RECORDS_PER_REQ);
prompt();
numRecPerReq->valueint = MAX_RECORDS_PER_REQ; numRecPerReq->valueint = MAX_RECORDS_PER_REQ;
} }
g_args.num_of_RPR = numRecPerReq->valueint; g_args.num_of_RPR = numRecPerReq->valueint;
...@@ -3536,9 +3539,9 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { ...@@ -3536,9 +3539,9 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
g_args.answer_yes = false; g_args.answer_yes = false;
} }
} else if (!answerPrompt) { } else if (!answerPrompt) {
g_args.answer_yes = false; g_args.answer_yes = true; // default is no, mean answer_yes.
} else { } 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; goto PARSE_OVER;
} }
...@@ -4007,10 +4010,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { ...@@ -4007,10 +4010,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
i, j, g_Dbs.db[i].superTbls[j].interlaceRows, g_args.num_of_RPR); i, j, g_Dbs.db[i].superTbls[j].interlaceRows, g_args.num_of_RPR);
printf(" interlace rows value will be set to num_of_records_per_req %"PRIu64"\n\n", printf(" interlace rows value will be set to num_of_records_per_req %"PRIu64"\n\n",
g_args.num_of_RPR); g_args.num_of_RPR);
if (!g_args.answer_yes) { prompt();
printf(" press Enter key to continue or Ctrl-C to stop.");
(void)getchar();
}
g_Dbs.db[i].superTbls[j].interlaceRows = g_args.num_of_RPR; g_Dbs.db[i].superTbls[j].interlaceRows = g_args.num_of_RPR;
} }
} else if (!stbInterlaceRows) { } else if (!stbInterlaceRows) {
...@@ -6263,10 +6263,7 @@ static int insertTestProcess() { ...@@ -6263,10 +6263,7 @@ static int insertTestProcess() {
if (g_fpOfInsertResult) if (g_fpOfInsertResult)
printfInsertMetaToFile(g_fpOfInsertResult); printfInsertMetaToFile(g_fpOfInsertResult);
if (!g_args.answer_yes) { prompt();
printf("Press enter key to continue\n\n");
(void)getchar();
}
init_rand_data(); init_rand_data();
...@@ -6536,10 +6533,7 @@ static int queryTestProcess() { ...@@ -6536,10 +6533,7 @@ static int queryTestProcess() {
&g_queryInfo.superQueryInfo.childTblCount); &g_queryInfo.superQueryInfo.childTblCount);
} }
if (!g_args.answer_yes) { prompt();
printf("Press enter key to continue\n\n");
(void)getchar();
}
if (g_args.debug_print || g_args.verbose_print) { if (g_args.debug_print || g_args.verbose_print) {
printfQuerySystemInfo(taos); printfQuerySystemInfo(taos);
...@@ -6977,10 +6971,7 @@ static int subscribeTestProcess() { ...@@ -6977,10 +6971,7 @@ static int subscribeTestProcess() {
printfQueryMeta(); printfQueryMeta();
resetAfterAnsiEscape(); resetAfterAnsiEscape();
if (!g_args.answer_yes) { prompt();
printf("Press enter key to continue\n\n");
(void) getchar();
}
TAOS * taos = NULL; TAOS * taos = NULL;
taos = taos_connect(g_queryInfo.host, taos = taos_connect(g_queryInfo.host,
......
...@@ -23,32 +23,32 @@ class TDTestCase: ...@@ -23,32 +23,32 @@ class TDTestCase:
def init(self, conn, logSql): def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__) tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql) tdSql.init(conn.cursor(), logSql)
def getBuildPath(self): def getBuildPath(self):
selfPath = os.path.dirname(os.path.realpath(__file__)) selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath): if "community" in selfPath:
projPath = selfPath[:selfPath.find("community")] projPath = selfPath[: selfPath.find("community")]
else: else:
projPath = selfPath[:selfPath.find("tests")] projPath = selfPath[: selfPath.find("tests")]
for root, dirs, files in os.walk(projPath): for root, dirs, files in os.walk(projPath):
if ("taosd" in files): if "taosd" in files:
rootRealPath = os.path.dirname(os.path.realpath(root)) rootRealPath = os.path.dirname(os.path.realpath(root))
if ("packaging" not in rootRealPath): if "packaging" not in rootRealPath:
buildPath = root[:len(root)-len("/build/bin")] buildPath = root[: len(root) - len("/build/bin")]
break break
return buildPath return buildPath
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
buildPath = self.getBuildPath() buildPath = self.getBuildPath()
if (buildPath == ""): if buildPath == "":
tdLog.exit("taosd not found!") tdLog.exit("taosd not found!")
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("yes | %staosdemo -f tools/insert.json" % binPath) os.system("%staosdemo -f tools/insert.json -y" % binPath)
tdSql.execute("use db01") tdSql.execute("use db01")
tdSql.query("select count(*) from stb01") tdSql.query("select count(*) from stb01")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册