Bug #2004 Connection Errors
Submitted: 3 Dec 2003 10:28 Modified: 30 May 2013 10:01
Reporter: Tony LBMX Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:3.51 OS:Windows (Win2000)
Assigned to: CPU Architecture:Any

[3 Dec 2003 10:28] Tony LBMX
Description:
Currently I have a process that runs every minute on my server. At the one minute mark I connect to the MySql database and execute the required statements.  Occasionally the connection to the database get lost - at which time I trap the error - exit the loop and wait for another minute to pass.  When the next cycle comes around I attempt to reconnect to the database and the call to open succeeds - although there is now way it should succeed (the network cable is unplugged).  I am using ADO 2.5, VB 6.0 and Mysql ODBC Drive V3.51

How to repeat:
open a connection to the database
Attempt to update several rows in the database
While update is occuring unplug computer from the network (and therefore from the db)
Trap the lost connection error
Attempt to reconnect to the Db (while the network cable is still unplugged)
ADO Open call does not throw an error and the state is set to 1 (open)
[3 Dec 2003 12:22] MySQL Verification Team
I did a test creating an DSN MyODBC and connected with a server running
on Linux Box and I wasn't able to repeat the listen condition that you
are mentioned:

Connected with the server:

C:\>netstat

Conexões ativas

  Proto  Endereço local         Endereço externo       Estado
<cut>
  TCP    light:1254             192.168.0.77:3306      ESTABLISHED

now I shutdown the machine running the MySQL server and the machine
client:

C:\>netstat

Conexões ativas

  Proto  Endereço local         Endereço externo       Estado
 <cut>
  TCP    light:1254             192.168.0.77:3306      CLOSE_WAIT

now I close the ODBC connection:

C:\>netstat

Conexões ativas

  Proto  Endereço local         Endereço externo       Estado
<cut>
  TCP    light:1254             192.168.0.77:3306      LAST_ACK

if I try to connect with the CLOSE_WAIT state I get:

		dbc:		szSqlState = "HY000", *pfNativeError = 2003, *pcbErrorMsg = 80
										MessageText = "[MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on '192.168.0.77' (10060)"

Please verify if you aren't get a message error which means CLOSE_WAIT rather
than ESTABLISHED ?.
[30 May 2013 10:01] Bogdan Degtyariov
I'm closing this bug because I can not continue without feedback from the reporter. If you have new info, please reopen the report.