Bug #39006 regression - "main.mysql" test fails on Mac OSX
Submitted: 25 Aug 2008 12:34 Modified: 23 Oct 2008 23:55
Reporter: Giuseppe Maxia Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.1.28, all OS:MacOS (10.5.4)
Assigned to: CPU Architecture:Any
Tags: error, messages, regression, test suite

[25 Aug 2008 12:34] Giuseppe Maxia
Description:
test "main.mysql" fails on Mac OSX 10.5.4.
The reason for the failure is due to the error code issued by the client when connecting to a non existing host.

On Linux, 
$ mysql -h _invalid_host_ --connect_timeout=1
ERROR 2005 (HY000): Unknown MySQL server host '_invalid_host_' (1)

On Mac OSX
$ mysql -h _invalid_host_ --connect_timeout=1
ERROR 2003 (HY000): Can't connect to MySQL server on '_invalid_host_' (4)

The failure in regression can be observer as far back as MySQL 5.1.20.

How to repeat:
# execute the following command on Linux and Mac

$ mysql -h _invalid_host_ --connect_timeout=1
[25 Aug 2008 15:24] Geert Vanderkelen
I can't repeat this using 5.1.28 on Mac OS 10.5.4. I have same message on Mac and Linux.
Maybe there is an issue with resolving the name or so..?

Black:~ geert$ /opt/local/mysql-5.1bzr/bin/mysql -h _invalid_host_ --connect_timeout=1
ERROR 2005 (HY000): Unknown MySQL server host '_invalid_host_' (1)
Black:~ geert$ uname -a
Darwin Black.local 9.4.0 Darwin Kernel Version 9.4.0: Mon Jun  9 19:30:53 PDT 2008; root:xnu-1228.5.20~1/RELEASE_I386 i386 i386
Black:~ geert$ /opt/local/mysql-5.1bzr/bin/mysql -BN -e "SELECT VERSION()" 
5.1.28-debug-log
[25 Aug 2008 15:48] Giuseppe Maxia
The difference is in resolveip behavior:

Linux:
$ ~/opt/mysql/5.1.28/bin/resolveip _invalid_
/home/gmax/opt/mysql/5.1.28/bin/resolveip: Unable to find hostid for '_invalid_': host not found

Mac OSX:
$ ~/opt/mysql/5.1.28/bin/resolveip _invalid_
IP address of _invalid_ is 212.48.8.140
[25 Aug 2008 17:07] Sveta Smirnova
Thank you for the feedback.

> The difference is in resolveip behavior:
> Linux:
> $ ~/opt/mysql/5.1.28/bin/resolveip _invalid_
> /home/gmax/opt/mysql/5.1.28/bin/resolveip: Unable to find hostid for '_invalid_': host not
found
> Mac OSX:
> $ ~/opt/mysql/5.1.28/bin/resolveip _invalid_
> IP address of _invalid_ is 212.48.8.140

If you have real address for invalid hostname this is expected what test case fail. It can be verified as test case issue though. Workaround: change your DNS settings. With suggested fix: check if there is no invalid_hostname on target machine.
[25 Aug 2008 17:24] Giuseppe Maxia
There is no _invalid_ hostname in my box. 
But apparently my ISP DNS can resolve it. 
The test suite should be make more robust to avoid this case. It can happen to any user, the same way that happened to me.
Asking to change the DNS to accommodate a test suite needs is a non acceptable workaround.

Changing the bug type as "tests"