Bug #5196 MYSQL_BIND.is_unsigned not documented
Submitted: 25 Aug 2004 2:57 Modified: 25 Aug 2004 19:58
Reporter: Matthew Lord Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:4.1.X (including 4.1.4-bk) OS:Any (all)
Assigned to: Paul Dubois CPU Architecture:Any
Triage: D4 (Minor)

[25 Aug 2004 2:57] Matthew Lord
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.
[25 Aug 2004 19:58] Paul Dubois
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).