未验证 提交 cdbd3df4 编写于 作者: H huili 提交者: GitHub

Merge pull request #5312 from taosdata/hotfix/test

[TD-3119]<fix> when only dbs.sql, dumpin error
......@@ -2109,13 +2109,15 @@ static void taosGetDirectoryFileList(char *inputDir)
if (fileStat.st_mode & S_IFDIR) {
taosCheckTablesSQLFile(inputDir);
tsSqlFileNum = taosGetFilesNum(inputDir, "sql");
int totalSQLFileNum = tsSqlFileNum;
int tsSqlFileNumOfTbls = tsSqlFileNum;
if (tsDbSqlFile[0] != 0) {
tsSqlFileNum--;
tsSqlFileNumOfTbls--;
}
taosMallocSQLFiles();
taosParseDirectory(inputDir, "sql", tsDumpInSqlFiles, tsSqlFileNum);
fprintf(stdout, "\nstart to dispose %d files in %s\n", totalSQLFileNum, inputDir);
if (0 != tsSqlFileNumOfTbls) {
taosParseDirectory(inputDir, "sql", tsDumpInSqlFiles, tsSqlFileNumOfTbls);
}
fprintf(stdout, "\nstart to dispose %d files in %s\n", tsSqlFileNum, inputDir);
}
else {
fprintf(stderr, "ERROR: %s is not a directory\n", inputDir);
......@@ -2268,7 +2270,10 @@ int taosDumpIn(struct arguments *arguments) {
taosGetDirectoryFileList(arguments->inpath);
int32_t tsSqlFileNumOfTbls = tsSqlFileNum;
if (tsDbSqlFile[0] != 0) {
tsSqlFileNumOfTbls--;
fp = taosOpenDumpInFile(tsDbSqlFile);
if (NULL == fp) {
fprintf(stderr, "failed to open input file %s\n", tsDbSqlFile);
......@@ -2281,7 +2286,9 @@ int taosDumpIn(struct arguments *arguments) {
taosDumpInOneFile(taos, fp, tsfCharset, arguments->encode, tsDbSqlFile);
}
taosStartDumpInWorkThreads(taos, arguments);
if (0 != tsSqlFileNumOfTbls) {
taosStartDumpInWorkThreads(taos, arguments);
}
taos_close(taos);
taosFreeSQLFiles();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册