diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index 7a44870938f943e1aec667f4ecf0890fd394ff43..b38e6377a9e56d38966d9b3b13d8d87735972c4b 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -157,7 +157,7 @@ typedef struct SParamInfo { int32_t idx; char type; uint8_t timePrec; - short bytes; + int16_t bytes; uint32_t offset; } SParamInfo; diff --git a/src/client/src/tscPrepare.c b/src/client/src/tscPrepare.c index 3ddfc1c34126d5b1d26a8dafb2e6e1e2481c880a..0df1c7ddc514f133f8c4b53852613b8c212ecfb6 100644 --- a/src/client/src/tscPrepare.c +++ b/src/client/src/tscPrepare.c @@ -298,7 +298,7 @@ static int doBindParam(char* data, SParamInfo* param, TAOS_BIND* bind) { break; case TSDB_DATA_TYPE_BINARY: - if ((*bind->length) > param->bytes) { + if ((*bind->length) > (uintptr_t)param->bytes) { return TSDB_CODE_TSC_INVALID_VALUE; } size = (short)*bind->length; diff --git a/src/inc/taos.h b/src/inc/taos.h index 1d609bc7dbb7f5fe9bc1c26b169fcbdbac973cef..f3cc9bb4d79f1ca23d983154e7dad17f07802926 100644 --- a/src/inc/taos.h +++ b/src/inc/taos.h @@ -72,8 +72,8 @@ DLL_EXPORT void taos_close(TAOS *taos); typedef struct TAOS_BIND { int buffer_type; void * buffer; - unsigned long buffer_length; // unused - unsigned long *length; + uintptr_t buffer_length; // unused + uintptr_t *length; int * is_null; int is_unsigned; // unused int * error; // unused