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

Merge pull request #5355 from taosdata/hotfix/sangshuduo/TD-3177-fix-demo-c-mistake

[TD-3177] <fix>: fix demo.c checking result error mistake.
...@@ -27,7 +27,6 @@ tests/hdfs/ ...@@ -27,7 +27,6 @@ tests/hdfs/
nmake/ nmake/
sln/ sln/
hdfs/ hdfs/
c/
taoshebei/ taoshebei/
taosdalipu/ taosdalipu/
Target/ Target/
......
...@@ -92,15 +92,14 @@ void Test(TAOS *taos, char *qstr, int index) { ...@@ -92,15 +92,14 @@ void Test(TAOS *taos, char *qstr, int index) {
// printf("insert row: %i, reason:%s\n", i, taos_errstr(taos)); // printf("insert row: %i, reason:%s\n", i, taos_errstr(taos));
// } // }
TAOS_RES *result1 = taos_query(taos, qstr); TAOS_RES *result1 = taos_query(taos, qstr);
if (result1) { if (result1 == NULL || taos_errno(result1) != 0) {
printf("insert row: %i\n", i); printf("failed to insert row, reason:%s\n", taos_errstr(result1));
} else {
printf("failed to insert row: %i, reason:%s\n", i, "null result"/*taos_errstr(result)*/);
taos_free_result(result1); taos_free_result(result1);
exit(1); exit(1);
} else {
printf("insert row: %i\n", i);
} }
taos_free_result(result1); taos_free_result(result1);
} }
printf("success to insert rows, total %d rows\n", i); printf("success to insert rows, total %d rows\n", i);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册