提交 4886938f 编写于 作者: S shenglian zhou

test async

上级 6cd9d293
...@@ -750,6 +750,10 @@ static int32_t arrangePointsByChildTableName(TAOS_SML_DATA_POINT* points, int nu ...@@ -750,6 +750,10 @@ static int32_t arrangePointsByChildTableName(TAOS_SML_DATA_POINT* points, int nu
return 0; return 0;
} }
void insertCallback(void* param, TAOS_RES* res, int code) {
taos_close(res);
}
static int32_t applyChildTableDataPointsWithInsertSQL(TAOS* taos, char* cTableName, char* sTableName, SSmlSTableSchema* sTableSchema, static int32_t applyChildTableDataPointsWithInsertSQL(TAOS* taos, char* cTableName, char* sTableName, SSmlSTableSchema* sTableSchema,
SArray* cTablePoints, size_t rowSize, SSmlLinesInfo* info) { SArray* cTablePoints, size_t rowSize, SSmlLinesInfo* info) {
int32_t code = TSDB_CODE_SUCCESS; int32_t code = TSDB_CODE_SUCCESS;
...@@ -784,9 +788,6 @@ static int32_t applyChildTableDataPointsWithInsertSQL(TAOS* taos, char* cTableNa ...@@ -784,9 +788,6 @@ static int32_t applyChildTableDataPointsWithInsertSQL(TAOS* taos, char* cTableNa
snprintf(sql + strlen(sql), freeBytes-strlen(sql), " tags ("); snprintf(sql + strlen(sql), freeBytes-strlen(sql), " tags (");
// for (int i = 0; i < numTags; ++i) {
// snprintf(sql+strlen(sql), freeBytes-strlen(sql), "?,");
// }
for (int i = 0; i < numTags; ++i) { for (int i = 0; i < numTags; ++i) {
if (tagKVs[i] == NULL) { if (tagKVs[i] == NULL) {
snprintf(sql + strlen(sql), freeBytes-strlen(sql), "NULL,"); snprintf(sql + strlen(sql), freeBytes-strlen(sql), "NULL,");
...@@ -833,9 +834,10 @@ static int32_t applyChildTableDataPointsWithInsertSQL(TAOS* taos, char* cTableNa ...@@ -833,9 +834,10 @@ static int32_t applyChildTableDataPointsWithInsertSQL(TAOS* taos, char* cTableNa
sql[strlen(sql)] = '\0'; sql[strlen(sql)] = '\0';
tscDebug("SML:0x%"PRIx64" insert child table table %s of super table %s : %s", info->id, cTableName, sTableName, sql); tscDebug("SML:0x%"PRIx64" insert child table table %s of super table %s : %s", info->id, cTableName, sTableName, sql);
TAOS_RES* res = taos_query(taos, sql); taos_query_a(taos, sql, insertCallback, NULL);
code = taos_errno(res); // TAOS_RES* res = taos_query(taos, sql);
info->affectedRows = taos_affected_rows(res); // code = taos_errno(res);
// info->affectedRows = taos_affected_rows(res);
return code; return code;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册