提交 33bcee62 编写于 作者: H Haojun Liao

[td-14393] refactor.

上级 928cbcec
......@@ -163,6 +163,7 @@ typedef struct SReqResultInfo {
uint64_t totalRows;
uint32_t current;
bool completed;
int32_t precision;
int32_t payloadLen;
} SReqResultInfo;
......
......@@ -825,6 +825,7 @@ int32_t setQueryResultFromRsp(SReqResultInfo* pResultInfo, const SRetrieveTableR
pResultInfo->current = 0;
pResultInfo->completed = (pRsp->completed == 1);
pResultInfo->payloadLen = htonl(pRsp->compLen);
pResultInfo->precision = pRsp->precision;
// TODO handle the compressed case
pResultInfo->totalRows += pResultInfo->numOfRows;
......
......@@ -323,7 +323,12 @@ int taos_affected_rows(TAOS_RES *res) {
}
int taos_result_precision(TAOS_RES *res) {
return TSDB_TIME_PRECISION_MILLI;
SRequestObj* pRequest = (SRequestObj*) res;
if (pRequest == NULL) {
return TSDB_TIME_PRECISION_MILLI;
}
return pRequest->body.resInfo.precision;
}
int taos_select_db(TAOS *taos, const char *db) {
......
......@@ -400,6 +400,7 @@ TEST(testCase, show_vgroup_Test) {
taos_free_result(pRes);
taos_close(pConn);
}
#endif
TEST(testCase, create_multiple_tables) {
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
......@@ -458,7 +459,7 @@ TEST(testCase, create_multiple_tables) {
taos_free_result(pRes);
for (int32_t i = 0; i < 20; ++i) {
for (int32_t i = 0; i < 25000; ++i) {
char sql[512] = {0};
snprintf(sql, tListLen(sql),
"create table t_x_%d using st1 tags(2) t_x_%d using st1 tags(5) t_x_%d using st1 tags(911)", i,
......@@ -652,7 +653,6 @@ TEST(testCase, projection_query_stables) {
taos_free_result(pRes);
taos_close(pConn);
}
#endif
TEST(testCase, agg_query_tables) {
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册