Bug #69068 Inaccurate documentation for 22.8.6.15 mysql_error & 22.8.10.9 mysql_stmt_error
Submitted: 25 Apr 2013 12:34 Modified: 29 Apr 2013 13:35
Reporter: Douglas Boffey Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S5 (Performance)
Version:5.6.10 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[25 Apr 2013 12:34] Douglas Boffey
Description:
In para. 22.8.6.15 mysql_error(), the following line appears,

“For functions that reset mysql_error(), the following two tests are equivalent:…”

Whilst this is true, it is true independent of how mysql_error(&mysql) behaves.

Again, in para. 22.8.10.9 mysql_stmt_error(), we read,

“This means the following two tests are equivalent:…”

This is inaccurate, as it the equivalence of the two tests are due to the C language, not the functions.

How to repeat:
N/A

Suggested fix:
I expect that a statement like “This means that either of the following two tests can be used:…” would be better.
[25 Apr 2013 13:28] Paul DuBois
Both functions return char*. Why does the equivalence hold in one case but not the other?
[27 Apr 2013 14:01] Douglas Boffey
The problem is that the conditions, “*mysql_error(&mysql)” and “mysql_error(&mysql)[0]” are two different ways of saying the same thing in C, whereas the accompanying text suggests (22.8.6.15), or implies (22.8.10.9) that the equivalence is due to how the functions work.
[29 Apr 2013 13:35] 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 products.

I'll remove "this means" and "equivalence" to simply state that either test can be used.

"Either of these two tests can be used to check for an error"