refactor stmt2_get_fields
This commit is contained in:
parent
5c1d36159f
commit
f6b9bc44c7
|
@ -111,14 +111,14 @@ typedef struct TAOS_FIELD_E {
|
|||
int32_t bytes;
|
||||
} TAOS_FIELD_E;
|
||||
|
||||
typedef struct TAOS_FIELD_STB {
|
||||
typedef struct TAOS_FIELD_ALL {
|
||||
char name[65];
|
||||
int8_t type;
|
||||
uint8_t precision;
|
||||
uint8_t scale;
|
||||
int32_t bytes;
|
||||
uint8_t field_type;
|
||||
} TAOS_FIELD_STB;
|
||||
} TAOS_FIELD_ALL;
|
||||
|
||||
#ifdef WINDOWS
|
||||
#define DLL_EXPORT __declspec(dllexport)
|
||||
|
@ -250,10 +250,8 @@ DLL_EXPORT int taos_stmt2_bind_param(TAOS_STMT2 *stmt, TAOS_STMT2_BINDV
|
|||
DLL_EXPORT int taos_stmt2_exec(TAOS_STMT2 *stmt, int *affected_rows);
|
||||
DLL_EXPORT int taos_stmt2_close(TAOS_STMT2 *stmt);
|
||||
DLL_EXPORT int taos_stmt2_is_insert(TAOS_STMT2 *stmt, int *insert);
|
||||
DLL_EXPORT int taos_stmt2_get_fields(TAOS_STMT2 *stmt, TAOS_FIELD_T field_type, int *count, TAOS_FIELD_E **fields);
|
||||
DLL_EXPORT int taos_stmt2_get_stb_fields(TAOS_STMT2 *stmt, int *count, TAOS_FIELD_STB **fields);
|
||||
DLL_EXPORT void taos_stmt2_free_fields(TAOS_STMT2 *stmt, TAOS_FIELD_E *fields);
|
||||
DLL_EXPORT void taos_stmt2_free_stb_fields(TAOS_STMT2 *stmt, TAOS_FIELD_STB *fields);
|
||||
DLL_EXPORT int taos_stmt2_get_fields(TAOS_STMT2 *stmt, int *count, TAOS_FIELD_ALL **fields);
|
||||
DLL_EXPORT void taos_stmt2_free_fields(TAOS_STMT2 *stmt, TAOS_FIELD_ALL *fields);
|
||||
DLL_EXPORT TAOS_RES *taos_stmt2_result(TAOS_STMT2 *stmt);
|
||||
DLL_EXPORT char *taos_stmt2_error(TAOS_STMT2 *stmt);
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ int32_t qBindStmtSingleColValue(void* pBlock, SArray* pCols, TAOS_MULTI_BIND* bi
|
|||
int32_t colIdx, int32_t rowNum, void* charsetCxt);
|
||||
int32_t qBuildStmtColFields(void* pDataBlock, int32_t* fieldNum, TAOS_FIELD_E** fields);
|
||||
int32_t qBuildStmtStbColFields(void* pBlock, void* boundTags, bool hasCtbName, int32_t* fieldNum,
|
||||
TAOS_FIELD_STB** fields);
|
||||
TAOS_FIELD_ALL** fields);
|
||||
int32_t qBuildStmtTagFields(void* pBlock, void* boundTags, int32_t* fieldNum, TAOS_FIELD_E** fields);
|
||||
int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const char* sTableName, char* tName,
|
||||
TAOS_MULTI_BIND* bind, char* msgBuf, int32_t msgBufLen, void* charsetCxt);
|
||||
|
|
|
@ -222,7 +222,7 @@ int stmtSetTbTags2(TAOS_STMT2 *stmt, TAOS_STMT2_BIND *tags);
|
|||
int stmtBindBatch2(TAOS_STMT2 *stmt, TAOS_STMT2_BIND *bind, int32_t colIdx);
|
||||
int stmtGetTagFields2(TAOS_STMT2 *stmt, int *nums, TAOS_FIELD_E **fields);
|
||||
int stmtGetColFields2(TAOS_STMT2 *stmt, int *nums, TAOS_FIELD_E **fields);
|
||||
int stmtGetStbColFields2(TAOS_STMT2 *stmt, int *nums, TAOS_FIELD_STB **fields);
|
||||
int stmtGetStbColFields2(TAOS_STMT2 *stmt, int *nums, TAOS_FIELD_ALL **fields);
|
||||
int stmtGetParamNum2(TAOS_STMT2 *stmt, int *nums);
|
||||
int stmtGetParamTbName(TAOS_STMT2 *stmt, int *nums);
|
||||
int stmtIsInsert2(TAOS_STMT2 *stmt, int *insert);
|
||||
|
|
|
@ -2249,29 +2249,29 @@ int taos_stmt2_is_insert(TAOS_STMT2 *stmt, int *insert) {
|
|||
return stmtIsInsert2(stmt, insert);
|
||||
}
|
||||
|
||||
int taos_stmt2_get_fields(TAOS_STMT2 *stmt, TAOS_FIELD_T field_type, int *count, TAOS_FIELD_E **fields) {
|
||||
if (stmt == NULL || count == NULL) {
|
||||
tscError("NULL parameter for %s", __FUNCTION__);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
// int taos_stmt2_get_fields(TAOS_STMT2 *stmt, TAOS_FIELD_T field_type, int *count, TAOS_FIELD_E **fields) {
|
||||
// if (stmt == NULL || count == NULL) {
|
||||
// tscError("NULL parameter for %s", __FUNCTION__);
|
||||
// terrno = TSDB_CODE_INVALID_PARA;
|
||||
// return terrno;
|
||||
// }
|
||||
|
||||
if (field_type == TAOS_FIELD_COL) {
|
||||
return stmtGetColFields2(stmt, count, fields);
|
||||
} else if (field_type == TAOS_FIELD_TAG) {
|
||||
return stmtGetTagFields2(stmt, count, fields);
|
||||
} else if (field_type == TAOS_FIELD_QUERY) {
|
||||
return stmtGetParamNum2(stmt, count);
|
||||
} else if (field_type == TAOS_FIELD_TBNAME) {
|
||||
return stmtGetParamTbName(stmt, count);
|
||||
} else {
|
||||
tscError("invalid parameter for %s", __FUNCTION__);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
// if (field_type == TAOS_FIELD_COL) {
|
||||
// return stmtGetColFields2(stmt, count, fields);
|
||||
// } else if (field_type == TAOS_FIELD_TAG) {
|
||||
// return stmtGetTagFields2(stmt, count, fields);
|
||||
// } else if (field_type == TAOS_FIELD_QUERY) {
|
||||
// return stmtGetParamNum2(stmt, count);
|
||||
// } else if (field_type == TAOS_FIELD_TBNAME) {
|
||||
// return stmtGetParamTbName(stmt, count);
|
||||
// } else {
|
||||
// tscError("invalid parameter for %s", __FUNCTION__);
|
||||
// terrno = TSDB_CODE_INVALID_PARA;
|
||||
// return terrno;
|
||||
// }
|
||||
// }
|
||||
|
||||
int taos_stmt2_get_stb_fields(TAOS_STMT2 *stmt, int *count, TAOS_FIELD_STB **fields) {
|
||||
int taos_stmt2_get_fields(TAOS_STMT2 *stmt, int *count, TAOS_FIELD_ALL **fields) {
|
||||
if (stmt == NULL || count == NULL) {
|
||||
tscError("NULL parameter for %s", __FUNCTION__);
|
||||
terrno = TSDB_CODE_INVALID_PARA;
|
||||
|
@ -2293,13 +2293,7 @@ int taos_stmt2_get_stb_fields(TAOS_STMT2 *stmt, int *count, TAOS_FIELD_STB **fie
|
|||
return stmtGetStbColFields2(stmt, count, fields);
|
||||
}
|
||||
|
||||
void taos_stmt2_free_fields(TAOS_STMT2 *stmt, TAOS_FIELD_E *fields) {
|
||||
(void)stmt;
|
||||
if (!fields) return;
|
||||
taosMemoryFree(fields);
|
||||
}
|
||||
|
||||
DLL_EXPORT void taos_stmt2_free_stb_fields(TAOS_STMT2 *stmt, TAOS_FIELD_STB *fields) {
|
||||
DLL_EXPORT void taos_stmt2_free_fields(TAOS_STMT2 *stmt, TAOS_FIELD_ALL *fields) {
|
||||
(void)stmt;
|
||||
if (!fields) return;
|
||||
taosMemoryFree(fields);
|
||||
|
|
|
@ -1070,7 +1070,7 @@ static int stmtFetchColFields2(STscStmt2* pStmt, int32_t* fieldNum, TAOS_FIELD_E
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
static int stmtFetchStbColFields2(STscStmt2* pStmt, int32_t* fieldNum, TAOS_FIELD_STB** fields) {
|
||||
static int stmtFetchStbColFields2(STscStmt2* pStmt, int32_t* fieldNum, TAOS_FIELD_ALL** fields) {
|
||||
if (pStmt->errCode != TSDB_CODE_SUCCESS) {
|
||||
return pStmt->errCode;
|
||||
}
|
||||
|
@ -1894,7 +1894,7 @@ int stmtGetColFields2(TAOS_STMT2* stmt, int* nums, TAOS_FIELD_E** fields) {
|
|||
return stmtFetchColFields2(stmt, nums, fields);
|
||||
}
|
||||
|
||||
int stmtGetStbColFields2(TAOS_STMT2* stmt, int* nums, TAOS_FIELD_STB** fields) {
|
||||
int stmtGetStbColFields2(TAOS_STMT2* stmt, int* nums, TAOS_FIELD_ALL** fields) {
|
||||
int32_t code = stmtParseColFields2(stmt);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
return code;
|
||||
|
|
|
@ -938,13 +938,17 @@ int32_t buildBoundFields(int32_t numOfBound, int16_t* boundColumns, SSchema* pSc
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t buildStbBoundFields(SBoundColInfo boundColsInfo, SSchema* pSchema, int32_t* fieldNum, TAOS_FIELD_STB** fields,
|
||||
int32_t buildStbBoundFields(SBoundColInfo boundColsInfo, SSchema* pSchema, int32_t* fieldNum, TAOS_FIELD_ALL** fields,
|
||||
STableMeta* pMeta, void* boundTags, bool preCtbname) {
|
||||
SBoundColInfo* tags = (SBoundColInfo*)boundTags;
|
||||
int32_t numOfBound = boundColsInfo.numOfBound + (tags->mixTagsCols ? 0 : tags->numOfBound) + (preCtbname ? 1 : 0);
|
||||
bool hastag = tags != NULL;
|
||||
int32_t numOfBound = boundColsInfo.numOfBound + (preCtbname ? 1 : 0);
|
||||
if (hastag) {
|
||||
numOfBound += tags->mixTagsCols ? 0 : tags->numOfBound;
|
||||
}
|
||||
int32_t idx = 0;
|
||||
if (fields != NULL) {
|
||||
*fields = taosMemoryCalloc(numOfBound, sizeof(TAOS_FIELD_STB));
|
||||
*fields = taosMemoryCalloc(numOfBound, sizeof(TAOS_FIELD_ALL));
|
||||
if (NULL == *fields) {
|
||||
return terrno;
|
||||
}
|
||||
|
@ -957,7 +961,7 @@ int32_t buildStbBoundFields(SBoundColInfo boundColsInfo, SSchema* pSchema, int32
|
|||
idx++;
|
||||
}
|
||||
|
||||
if (tags->numOfBound > 0 && !tags->mixTagsCols) {
|
||||
if (hastag && tags->numOfBound > 0 && !tags->mixTagsCols) {
|
||||
SSchema* tagSchema = getTableTagSchema(pMeta);
|
||||
|
||||
for (int32_t i = 0; i < tags->numOfBound; ++i) {
|
||||
|
@ -1054,7 +1058,7 @@ int32_t qBuildStmtColFields(void* pBlock, int32_t* fieldNum, TAOS_FIELD_E** fiel
|
|||
}
|
||||
|
||||
int32_t qBuildStmtStbColFields(void* pBlock, void* boundTags, bool preCtbname, int32_t* fieldNum,
|
||||
TAOS_FIELD_STB** fields) {
|
||||
TAOS_FIELD_ALL** fields) {
|
||||
STableDataCxt* pDataBlock = (STableDataCxt*)pBlock;
|
||||
SSchema* pSchema = getTableColumnSchema(pDataBlock->pMeta);
|
||||
if (pDataBlock->boundColsInfo.numOfBound <= 0) {
|
||||
|
|
|
@ -58,8 +58,8 @@ void do_stmt(TAOS* taos) {
|
|||
}
|
||||
|
||||
int fieldNum = 0;
|
||||
TAOS_FIELD_STB* pFields = NULL;
|
||||
code = taos_stmt2_get_stb_fields(stmt, &fieldNum, &pFields);
|
||||
TAOS_FIELD_ALL* pFields = NULL;
|
||||
code = taos_stmt2_get_fields(stmt, &fieldNum, &pFields);
|
||||
if (code != 0) {
|
||||
printf("failed get col,ErrCode: 0x%x, ErrMessage: %s.\n", code, taos_stmt2_error(stmt));
|
||||
} else {
|
||||
|
@ -70,6 +70,7 @@ void do_stmt(TAOS* taos) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
int64_t ts = 1591060628000;
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
v.ts[i] = ts++;
|
||||
|
@ -88,6 +89,7 @@ void do_stmt(TAOS* taos) {
|
|||
return;
|
||||
}
|
||||
|
||||
taos_stmt2_free_fields(stmt, pFields);
|
||||
taos_stmt2_close(stmt);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ void getFields(TAOS *taos, const char *sql) {
|
|||
return;
|
||||
}
|
||||
int fieldNum = 0;
|
||||
TAOS_FIELD_STB *pFields = NULL;
|
||||
code = taos_stmt2_get_stb_fields(stmt, &fieldNum, &pFields);
|
||||
TAOS_FIELD_ALL *pFields = NULL;
|
||||
code = taos_stmt2_get_fields(stmt, &fieldNum, &pFields);
|
||||
if (code != 0) {
|
||||
printf("failed get col,ErrCode: 0x%x, ErrMessage: %s.\n", code, taos_stmt2_error(stmt));
|
||||
} else {
|
||||
|
@ -28,7 +28,7 @@ void getFields(TAOS *taos, const char *sql) {
|
|||
}
|
||||
}
|
||||
printf("====================================\n");
|
||||
taos_stmt2_free_stb_fields(stmt, pFields);
|
||||
taos_stmt2_free_fields(stmt, pFields);
|
||||
taos_stmt2_close(stmt);
|
||||
}
|
||||
|
||||
|
@ -42,15 +42,15 @@ void getQueryFields(TAOS *taos, const char *sql) {
|
|||
return;
|
||||
}
|
||||
int fieldNum = 0;
|
||||
TAOS_FIELD_STB *pFields = NULL;
|
||||
code = taos_stmt2_get_stb_fields(stmt, &fieldNum, &pFields);
|
||||
TAOS_FIELD_ALL *pFields = NULL;
|
||||
code = taos_stmt2_get_fields(stmt, &fieldNum, &pFields);
|
||||
if (code != 0) {
|
||||
printf("failed get col,ErrCode: 0x%x, ErrMessage: %s.\n", code, taos_stmt2_error(stmt));
|
||||
} else {
|
||||
printf("bind nums:%d\n", fieldNum);
|
||||
}
|
||||
printf("====================================\n");
|
||||
taos_stmt2_free_stb_fields(stmt, pFields);
|
||||
taos_stmt2_free_fields(stmt, pFields);
|
||||
taos_stmt2_close(stmt);
|
||||
}
|
||||
|
||||
|
|
|
@ -205,11 +205,11 @@ void veriry_stmt(TAOS* taos) {
|
|||
return;
|
||||
}
|
||||
printf("param_count: %d\n", param_count);
|
||||
*/
|
||||
TAOS_FIELD_E* fields = NULL;
|
||||
*/
|
||||
TAOS_FIELD_ALL* fields = NULL;
|
||||
int field_count = -1;
|
||||
start = clock();
|
||||
code = taos_stmt2_get_fields(stmt, TAOS_FIELD_COL, &field_count, NULL);
|
||||
code = taos_stmt2_get_fields(stmt, &field_count, &fields);
|
||||
end = clock();
|
||||
printf("get fields time:%f\n", (double)(end - start) / CLOCKS_PER_SEC);
|
||||
if (code != 0) {
|
||||
|
|
|
@ -292,10 +292,10 @@ _bind_again:
|
|||
}
|
||||
printf("param_count: %d\n", param_count);
|
||||
*/
|
||||
TAOS_FIELD_E* fields = NULL;
|
||||
TAOS_FIELD_ALL* fields = NULL;
|
||||
int field_count = -1;
|
||||
start = clock();
|
||||
code = taos_stmt2_get_fields(stmt, TAOS_FIELD_TBNAME, &field_count, NULL);
|
||||
code = taos_stmt2_get_fields(stmt, &field_count, &fields);
|
||||
end = clock();
|
||||
printf("get fields time:%f\n", (double)(end - start) / CLOCKS_PER_SEC);
|
||||
if (code != 0) {
|
||||
|
|
|
@ -35,8 +35,8 @@ typedef struct {
|
|||
} FuncInfo;
|
||||
|
||||
typedef enum {
|
||||
BP_BIND_TAG = 1,
|
||||
BP_BIND_COL,
|
||||
BP_BIND_COL = 1,
|
||||
BP_BIND_TAG,
|
||||
} BP_BIND_TYPE;
|
||||
|
||||
#define BP_BIND_TYPE_STR(t) (((t) == BP_BIND_COL) ? "column" : "tag")
|
||||
|
@ -385,7 +385,7 @@ void *taosMemoryMalloc(uint64_t size) { return malloc(size); }
|
|||
|
||||
void *taosMemoryCalloc(int32_t num, int32_t size) { return calloc(num, size); }
|
||||
void taosMemoryFree(const void *ptr) {
|
||||
if (ptr == NULL) return;
|
||||
if (ptr == NULL) return;
|
||||
|
||||
return free((void *)ptr);
|
||||
}
|
||||
|
@ -1303,23 +1303,23 @@ static int st_stmt2_exec(TAOS_STMT2 *stmt, int *affected_rows) { return taos_stm
|
|||
|
||||
static int st_stmt2_is_insert(TAOS_STMT2 *stmt, int *insert) { return taos_stmt2_is_insert(stmt, insert); }
|
||||
|
||||
static int st_stmt2_num_params(TAOS_STMT2 *stmt, int *count) {
|
||||
return taos_stmt2_get_fields(stmt, TAOS_FIELD_QUERY, count, NULL);
|
||||
}
|
||||
// static int st_stmt2_num_params(TAOS_STMT2 *stmt, int *count) {
|
||||
// return taos_stmt2_get_fields(stmt, count, NULL);
|
||||
// }
|
||||
|
||||
static int st_stmt2_get_tag_fields(TAOS_STMT2 *stmt, int *count, TAOS_FIELD_E **fields) {
|
||||
return taos_stmt2_get_fields(stmt, TAOS_FIELD_TAG, count, fields);
|
||||
}
|
||||
// static int st_stmt2_get_tag_fields(TAOS_STMT2 *stmt, int *count, TAOS_FIELD_ALL **fields) {
|
||||
// return taos_stmt2_get_fields(stmt, count, fields);
|
||||
// }
|
||||
|
||||
static int st_stmt2_get_col_fields(TAOS_STMT2 *stmt, int *count, TAOS_FIELD_E **fields) {
|
||||
return taos_stmt2_get_fields(stmt, TAOS_FIELD_COL, count, fields);
|
||||
}
|
||||
// static int st_stmt2_get_col_fields(TAOS_STMT2 *stmt, int *count, TAOS_FIELD_E **fields) {
|
||||
// return taos_stmt2_get_fields(stmt, TAOS_FIELD_COL, count, fields);
|
||||
// }
|
||||
|
||||
static int st_stmt2_get_param(TAOS_STMT2 *stmt, int idx, int *type, int *bytes) {
|
||||
int32_t code = 0, nums = 0;
|
||||
TAOS_FIELD_E *fields = NULL;
|
||||
int32_t code = 0, nums = 0;
|
||||
TAOS_FIELD_ALL *fields = NULL;
|
||||
|
||||
code = taos_stmt2_get_fields(stmt, TAOS_FIELD_COL, &nums, &fields);
|
||||
code = taos_stmt2_get_fields(stmt, &nums, &fields);
|
||||
if (code) {
|
||||
return code;
|
||||
}
|
||||
|
@ -1398,8 +1398,8 @@ void bpCheckIsInsert(TAOS_STMT2 *stmt, int32_t insert) {
|
|||
|
||||
void bpCheckParamNum(TAOS_STMT2 *stmt) {
|
||||
int32_t num = 0;
|
||||
if (st_stmt2_num_params(stmt, &num)) {
|
||||
printf("!!!st_stmt2_num_params error:%s\n", st_stmt2_error(stmt));
|
||||
if (taos_stmt2_get_fields(stmt, &num, NULL)) {
|
||||
printf("!!!taos_stmt2_get_fields error:%s\n", st_stmt2_error(stmt));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -1468,7 +1468,7 @@ void bpCheckQueryResult(TAOS_STMT2 *stmt, TAOS *taos, char *stmtSql, TAOS_STMT2_
|
|||
printf("***sql res num match stmt res num %d\n", stmtResNum);
|
||||
}
|
||||
|
||||
void bpCheckColTagFields(TAOS_STMT2 *stmt, int32_t fieldNum, TAOS_FIELD_E *pFields, int32_t expecteNum,
|
||||
void bpCheckColTagFields(TAOS_STMT2 *stmt, int32_t fieldNum, TAOS_FIELD_ALL *pFields, int32_t expecteNum,
|
||||
TAOS_STMT2_BIND *pBind, BP_BIND_TYPE type) {
|
||||
int32_t code = 0;
|
||||
|
||||
|
@ -1485,6 +1485,11 @@ void bpCheckColTagFields(TAOS_STMT2 *stmt, int32_t fieldNum, TAOS_FIELD_E *pFiel
|
|||
}
|
||||
|
||||
for (int32_t i = 0; i < fieldNum; ++i) {
|
||||
if (pFields[i].field_type != type) {
|
||||
printf("!!!%s %dth field type %d mis-match expect type %d\n", BP_BIND_TYPE_STR(type), i, pFields[i].field_type,
|
||||
TAOS_FIELD_TAG);
|
||||
exit(1);
|
||||
}
|
||||
if (pFields[i].type != pBind[i].buffer_type) {
|
||||
printf("!!!%s %dth field type %d mis-match expect type %d\n", BP_BIND_TYPE_STR(type), i, pFields[i].type,
|
||||
pBind[i].buffer_type);
|
||||
|
@ -1545,17 +1550,17 @@ void bpCheckColTagFields(TAOS_STMT2 *stmt, int32_t fieldNum, TAOS_FIELD_E *pFiel
|
|||
}
|
||||
|
||||
void bpCheckTagFields(TAOS_STMT2 *stmt, TAOS_STMT2_BIND *pBind) {
|
||||
int32_t code = 0;
|
||||
int fieldNum = 0;
|
||||
TAOS_FIELD_E *pFields = NULL;
|
||||
code = st_stmt2_get_tag_fields(stmt, &fieldNum, &pFields);
|
||||
int32_t code = 0;
|
||||
int fieldNum = 0;
|
||||
TAOS_FIELD_ALL *pFields = NULL;
|
||||
code = taos_stmt2_get_fields(stmt, &fieldNum, &pFields);
|
||||
if (code != 0) {
|
||||
printf("!!!st_stmt2_get_tag_fields error:%s\n", st_stmt2_error(stmt));
|
||||
printf("!!!taos_stmt2_get_fields error:%s\n", st_stmt2_error(stmt));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
bpCheckColTagFields(stmt, fieldNum, pFields, gCurCase->bindTagNum, pBind, BP_BIND_TAG);
|
||||
taosMemoryFree(pFields);
|
||||
taos_stmt2_free_fields(stmt, pFields);
|
||||
}
|
||||
|
||||
void bpCheckColFields(TAOS_STMT2 *stmt, TAOS_STMT2_BIND *pBind) {
|
||||
|
@ -1563,10 +1568,10 @@ void bpCheckColFields(TAOS_STMT2 *stmt, TAOS_STMT2_BIND *pBind) {
|
|||
return;
|
||||
}
|
||||
|
||||
int32_t code = 0;
|
||||
int fieldNum = 0;
|
||||
TAOS_FIELD_E *pFields = NULL;
|
||||
code = st_stmt2_get_col_fields(stmt, &fieldNum, &pFields);
|
||||
int32_t code = 0;
|
||||
int fieldNum = 0;
|
||||
TAOS_FIELD_ALL *pFields = NULL;
|
||||
code = taos_stmt2_get_fields(stmt, &fieldNum, &pFields);
|
||||
if (code != 0) {
|
||||
printf("!!!st_stmt2_get_col_fields error:%s\n", st_stmt2_error(stmt));
|
||||
exit(1);
|
||||
|
|
|
@ -257,10 +257,10 @@ void veriry_stmt(TAOS* taos) {
|
|||
}
|
||||
printf("param_count: %d\n", param_count);
|
||||
*/
|
||||
TAOS_FIELD_E* fields = NULL;
|
||||
TAOS_FIELD_ALL* fields = NULL;
|
||||
int field_count = -1;
|
||||
start = clock();
|
||||
code = taos_stmt2_get_fields(stmt, TAOS_FIELD_COL, &field_count, NULL);
|
||||
code = taos_stmt2_get_fields(stmt, &field_count, NULL);
|
||||
end = clock();
|
||||
printf("get fields time:%f\n", (double)(end - start) / CLOCKS_PER_SEC);
|
||||
if (code != 0) {
|
||||
|
|
Loading…
Reference in New Issue