Description:
This is the MYSQL_BIND structure:
typedef struct st_mysql_bind
{
unsigned long *length; /* output length pointer */
my_bool *is_null; /* Pointer to null indicators */
void *buffer; /* buffer to get/put data */
enum enum_field_types buffer_type; /* buffer type */
unsigned long buffer_length; /* buffer length, must be set for str/binary */
/* Following are for internal use. Set by mysql_stmt_bind_param */
unsigned char *inter_buffer; /* for the current data position */
unsigned long offset; /* offset position for char/binary fetch */
unsigned long internal_length; /* Used if length is 0 */
unsigned int param_number; /* For null count and error messages */
unsigned int pack_length; /* Internal length for packed data */
my_bool is_unsigned; /* set if integer type is unsigned */
my_bool long_data_used; /* If used with mysql_send_long_data */
my_bool internal_is_null; /* Used if is_null is 0 */
void (*store_param_func)(NET *net, struct st_mysql_bind *param);
void (*fetch_result)(struct st_mysql_bind *, unsigned char **row);
void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *,
unsigned char **row);
} MYSQL_BIND;
is_unsigned is not documented and in order to insert (large) unsigned numbers through
MYSQL_BIND, you have to set the is_unsigned flag so that it's not truncated to 0.
How to repeat:
try to set MYSQL_BIND.buffer to an unsigned long w/o setting the is_unsigned flag.
Suggested fix:
Just needs to be documented.
Description: This is the MYSQL_BIND structure: typedef struct st_mysql_bind { unsigned long *length; /* output length pointer */ my_bool *is_null; /* Pointer to null indicators */ void *buffer; /* buffer to get/put data */ enum enum_field_types buffer_type; /* buffer type */ unsigned long buffer_length; /* buffer length, must be set for str/binary */ /* Following are for internal use. Set by mysql_stmt_bind_param */ unsigned char *inter_buffer; /* for the current data position */ unsigned long offset; /* offset position for char/binary fetch */ unsigned long internal_length; /* Used if length is 0 */ unsigned int param_number; /* For null count and error messages */ unsigned int pack_length; /* Internal length for packed data */ my_bool is_unsigned; /* set if integer type is unsigned */ my_bool long_data_used; /* If used with mysql_send_long_data */ my_bool internal_is_null; /* Used if is_null is 0 */ void (*store_param_func)(NET *net, struct st_mysql_bind *param); void (*fetch_result)(struct st_mysql_bind *, unsigned char **row); void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned char **row); } MYSQL_BIND; is_unsigned is not documented and in order to insert (large) unsigned numbers through MYSQL_BIND, you have to set the is_unsigned flag so that it's not truncated to 0. How to repeat: try to set MYSQL_BIND.buffer to an unsigned long w/o setting the is_unsigned flag. Suggested fix: Just needs to be documented.