Bug #17460 manual problem with MYSQL_BIND
Submitted: 16 Feb 2006 15:01 Modified: 19 Apr 2006 14:59
Reporter: Kish Shen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.0.18 OS:Linux (Linux)
Assigned to: Paul DuBois CPU Architecture:Any

[16 Feb 2006 15:01] Kish Shen
Description:
The on-line manual (for 5.0) states that the type of error field of MYSQL_BIND is my_bool, but in 5.0.18, it is * my_bool, and has to be assigned a valid address as it is written to.

The example in the section for mysql_stmt_fetch() does not initialise the error field for the MYSQL_BIND structure before calling mysql_stmt_bind_result(). I followed this example in writting my code, and got a segmentation fault in mysql_stmt_fetch(). I downloaded the source (for 5.0.18) and saw that the fault was occurring when trying to assign to the error field (which was not initialised) in line 4524 of libmysql.c.

How to repeat:
Not applicable, as this is a documentation problem

Suggested fix:
Update the manual for the description of MYSQL_BIND, and the example(s) that use it.
[for example, in mysql_stmt_fetch()]
[16 Feb 2006 22:24] MySQL Verification Team
Thank you for the bug report.
[19 Apr 2006 14:59] 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).
[19 Apr 2006 15:37] Paul DuBois
Kish,

It should be possible to leave the error member set to 0. If you
find that doing so results in an application crash, could you please
generate a reproducible test case and open a new bug report so
that this can be fixed?  Thanks.