Bug #61288 INET_ATON calculation example is not corret
Submitted: 25 May 2011 13:54 Modified: 25 May 2011 17:29
Reporter: Eber M. Duarte Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S2 (Serious)
Version:5.1 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[25 May 2011 13:54] Eber M. Duarte
Description:
Hi,

At documentation http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html#function_inet-ntoa we see an example of using INET_ATON:

mysql> SELECT INET_ATON('10.0.5.9');
        -> 167773449

Therefore, it says "For this example, the return value is calculated as 209×2563 + 207×2562 + 224×256 + 40.", that is, IP '209.207.224.40' in this case. So, IP used in the example doesn't match the IP used to depict how to calculate the integer value.

Best wishes,

Eber.

How to repeat:
Access documentation: http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html#function_inet-ntoa

Suggested fix:
Replace this text: "For this example, the return value is calculated as 209×2563 + 207×2562 + 224×256 + 40." 

By: 

"For this example, the return value is calculated as 10×256^3 + 0×256^2 + 5×256 + 9."
[25 May 2011 14:09] Valeriy Kravchuk
Thank you for the documentation request.
[25 May 2011 17:29] 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.

Thanks for spotting this. I changed the preceding example a few days ago but neglected to update the paragraph following it.