mariadb/mysql-test/suite
Ingo Struewing 7dacca0ff0 Bug#37267 - connect() EINPROGRESS failures mishandled in client library
We cann connect() in a non-blocking mode to be able to specify a
non-standard timeout.

The problem was that we did not fetch the status from the
non-blocking connect(). We assumed that poll() would not return
a POLLIN flag if the connect failed. But on some platforms this
is not true.

After a successful poll() we do now retrieve the status value
from connect() with getsockopt(...SO_ERROR...). Now we do know
if (and how) the connect failed.

The test case for my investigation was rpl.rlp_ssl1 on an
Ubuntu 9.04 x86_64 machine. Both, IPV4 and IPV6 were active.
'localhost' resolved first for IPV6 and then for IPV4. The
connection over IPV6 was blocked. rpl.rlp_ssl1 timed out
as it did not notice the failed connect(). The first read()
failed, which was interpreted as a master crash and the
connection was tried to reestablish with the same result
until the retry limit was reached.

With the fix, the connect() problem is immediately recognized,
and the connect() is retried on the second resolution for
'localhost', which is successful.


libmysqld/libmysqld.c:
  Bug#37267 - connect() EINPROGRESS failures mishandled in client library
  Changed a DBUG print string to distinguish the two mysql_real_connect()
  implementations in DBUG traces.
mysql-test/include/wait_for_slave_param.inc:
  Bug#37267 - connect() EINPROGRESS failures mishandled in client library
  Made timeout value available in error message.
mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result:
  Bug#37267 - connect() EINPROGRESS failures mishandled in client library
  Fixed test result. Connect error is now detected as CR_CONN_HOST_ERROR
  (2003) instead of CR_SERVER_LOST (2013).
sql-common/client.c:
  Bug#37267 - connect() EINPROGRESS failures mishandled in client library
  Added retrieval of the error code from the non-blocking connect().
  Added DBUG.
  Added comment.
2009-09-30 12:28:15 +02:00
..
binlog Merge mysql-next-mr --> mysql-trunk-signal 2009-09-17 03:20:11 -06:00
bugs Bug #38205 Row-based Replication (RBR) causes inconsistencies: HA_ERR_FOUND_DUPP_KEY 2009-04-09 16:05:41 +03:00
federated Merge 5.0-bugteam to 5.1-bugteam 2009-03-19 14:19:51 +05:30
funcs_1 merge mysql-next-mr-alik 2009-09-24 12:35:16 +02:00
funcs_2 merge 5.0-> 5.1 2009-04-24 13:00:17 -04:00
ibmdb2i Bug#45983 ibmdb2i_create_index_option=1 not working for primary key 2009-07-08 14:40:01 +05:30
im Move instance manager tests to it's own suite 2007-08-29 19:02:33 +02:00
innodb merge mysql-next-mr-alik 2009-09-24 12:35:16 +02:00
jp fixed jp test failures 2009-02-02 14:42:33 +04:00
large_tests This is the downport of 2009-09-11 22:26:35 +02:00
manual manual merge for bug_29136, bug#29309. 2007-10-13 23:12:50 +03:00
ndb Post merge fixes 2009-09-11 01:15:41 -06:00
ndb_team Merge BUG#43263 from 5.0-bugteam to 5.1-bugteam 2009-05-31 13:44:41 +08:00
parts Merge to mysql-next-mr 2009-09-28 09:39:50 +02:00
rpl Bug#37267 - connect() EINPROGRESS failures mishandled in client library 2009-09-30 12:28:15 +02:00
rpl_ndb new merge from trunk 2009-09-18 16:44:11 +02:00
stress Merge trift2.:/MySQL/M51/mysql-5.1 2008-02-22 16:14:27 +01:00
sys_vars Fixes to tests and their results, to account for differences between InnoDB 1.0.4 and the old builtin. 2009-08-07 22:04:53 +02:00