[td-14493] add a new api.
This commit is contained in:
parent
94b7081e97
commit
f4047aa120
|
@ -188,6 +188,7 @@ DLL_EXPORT void taos_stop_query(TAOS_RES *res);
|
||||||
DLL_EXPORT bool taos_is_null(TAOS_RES *res, int32_t row, int32_t col);
|
DLL_EXPORT bool taos_is_null(TAOS_RES *res, int32_t row, int32_t col);
|
||||||
DLL_EXPORT bool taos_is_update_query(TAOS_RES *res);
|
DLL_EXPORT bool taos_is_update_query(TAOS_RES *res);
|
||||||
DLL_EXPORT int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows);
|
DLL_EXPORT int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows);
|
||||||
|
DLL_EXPORT int *taos_get_column_data_offset(TAOS_RES *res, int columnIndex);
|
||||||
DLL_EXPORT int taos_validate_sql(TAOS *taos, const char *sql);
|
DLL_EXPORT int taos_validate_sql(TAOS *taos, const char *sql);
|
||||||
DLL_EXPORT void taos_reset_current_db(TAOS *taos);
|
DLL_EXPORT void taos_reset_current_db(TAOS *taos);
|
||||||
|
|
||||||
|
|
|
@ -385,11 +385,11 @@ bool taos_is_update_query(TAOS_RES *res) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) {
|
int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) {
|
||||||
if (res == NULL) {
|
SRequestObj *pRequest = (SRequestObj *)res;
|
||||||
|
if (pRequest == NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SRequestObj *pRequest = (SRequestObj *)res;
|
|
||||||
if (pRequest->type == TSDB_SQL_RETRIEVE_EMPTY_RESULT || pRequest->type == TSDB_SQL_INSERT ||
|
if (pRequest->type == TSDB_SQL_RETRIEVE_EMPTY_RESULT || pRequest->type == TSDB_SQL_INSERT ||
|
||||||
pRequest->code != TSDB_CODE_SUCCESS || taos_num_fields(res) == 0) {
|
pRequest->code != TSDB_CODE_SUCCESS || taos_num_fields(res) == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -405,6 +405,25 @@ int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) {
|
||||||
return pResultInfo->numOfRows;
|
return pResultInfo->numOfRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int *taos_get_column_data_offset(TAOS_RES *res, int columnIndex) {
|
||||||
|
SRequestObj *pRequest = (SRequestObj *)res;
|
||||||
|
if (pRequest == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t numOfFields = taos_num_fields(pRequest);
|
||||||
|
if (columnIndex < 0 || columnIndex >= numOfFields || numOfFields == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
TAOS_FIELD* pField = &pRequest->body.resInfo.userFields[columnIndex];
|
||||||
|
if (!IS_VAR_DATA_TYPE(pField->type)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return pRequest->body.resInfo.pCol[columnIndex].offset;
|
||||||
|
}
|
||||||
|
|
||||||
int taos_validate_sql(TAOS *taos, const char *sql) { return true; }
|
int taos_validate_sql(TAOS *taos, const char *sql) { return true; }
|
||||||
|
|
||||||
void taos_reset_current_db(TAOS *taos) {
|
void taos_reset_current_db(TAOS *taos) {
|
||||||
|
|
Loading…
Reference in New Issue