提交 e43f47b7 编写于 作者: L lihui

[add debug output]

上级 e212f221
...@@ -1937,7 +1937,7 @@ _dumpin_exit_failure: ...@@ -1937,7 +1937,7 @@ _dumpin_exit_failure:
return -1; return -1;
} }
int taosDumpInOneFile(TAOS * taos, FILE* fp, char* fcharset, char* encode) { int taosDumpInOneFile(TAOS * taos, FILE* fp, char* fcharset, char* encode, char* fileName) {
int read_len = 0; int read_len = 0;
char * cmd = NULL; char * cmd = NULL;
size_t cmd_len = 0; size_t cmd_len = 0;
...@@ -1970,7 +1970,8 @@ int taosDumpInOneFile(TAOS * taos, FILE* fp, char* fcharset, char* encode) { ...@@ -1970,7 +1970,8 @@ int taosDumpInOneFile(TAOS * taos, FILE* fp, char* fcharset, char* encode) {
memcpy(cmd + cmd_len, line, read_len); memcpy(cmd + cmd_len, line, read_len);
if (taos_query(taos, cmd)) { if (taos_query(taos, cmd)) {
fprintf(stderr, "DB error: %s line:%d\n", taos_errstr(taos), lineNo); fprintf(stderr, "DB error: %s line:%d, file:%s\n", taos_errstr(taos), lineNo, fileName);
fprintf(stderr, "Error SQL: %s\n", cmd);
/* free local resouce: allocated memory/metric-meta refcnt */ /* free local resouce: allocated memory/metric-meta refcnt */
TAOS_RES *pRes = taos_use_result(taos); TAOS_RES *pRes = taos_use_result(taos);
taos_free_result(pRes); taos_free_result(pRes);
...@@ -1996,7 +1997,8 @@ void* taosDumpInWorkThreadFp(void *arg) ...@@ -1996,7 +1997,8 @@ void* taosDumpInWorkThreadFp(void *arg)
if (NULL == fp) { if (NULL == fp) {
continue; continue;
} }
taosDumpInOneFile(pThread->taosCon, fp, tsfCharset, tsArguments.encode); fprintf(stderr, "Success Open input file: %s\n", SQLFileName);
taosDumpInOneFile(pThread->taosCon, fp, tsfCharset, tsArguments.encode, SQLFileName);
} }
} }
...@@ -2064,10 +2066,11 @@ int taosDumpIn(struct arguments *arguments) { ...@@ -2064,10 +2066,11 @@ int taosDumpIn(struct arguments *arguments) {
fprintf(stderr, "failed to open input file %s\n", tsDbSqlFile); fprintf(stderr, "failed to open input file %s\n", tsDbSqlFile);
return -1; return -1;
} }
fprintf(stderr, "Success Open input file: %s\n", tsDbSqlFile);
taosLoadFileCharset(fp, tsfCharset); taosLoadFileCharset(fp, tsfCharset);
taosDumpInOneFile(taos, fp, tsfCharset, arguments->encode); taosDumpInOneFile(taos, fp, tsfCharset, arguments->encode, tsDbSqlFile);
} }
taosStartDumpInWorkThreads(arguments); taosStartDumpInWorkThreads(arguments);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册