From: Martin J. Evans Date: December 13 2005 2:29pm Subject: Some metadata functions not spotting mysql server is dead and disappearing tables List-Archive: http://lists.mysql.com/myodbc/10517 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Hi, (I don't particularly like cross-posting so I sent a slightly different email to the dbi-users list in case anyone else hits this problem). I was attempting to use perl DBI and the ping method to see if the myodbc connection was still working and discovered that in myodbc 3.51.12 (at least) ping always returns true. What DBD::ODBC does for ping is basically: SQLTables(NOXXTABLE) returns SQL_SUCCESS SQLDescribeCol returns SQL_SUCCESS SQLBindCol returns SQL_SUCCESS SQLFetch returns SQL_NO_DATA i.e. no errors and no sign that the mysql server might be dead. In fact if you do this: SQLConnect/SQLDriverConnect to running mysql server add a table to mysql database from another connection stop the mysql server SQLTables(the new table) works SQLDescribeCol works SQLBindCol works SQLFetch returns SQL_NO_DATA new table not seen and myodbc has no idea the mysql server has been stopped (or so I thought): What gave away the problem was when I reversed the above. i.e. I created a table, connected via mysql odbc driver, ran SQLTables which showed the new table, closed mysql server down, ran SQLTables again and my table has disappeared. In fact, the database contains no tables at all! I think there is a bug here, where mysql odbc driver is attempting to contact the mysql server and when it fails it is not reporting it. This seems a rather serious issue to me since the app can't tell the server is dead via some metadata calls (just looks like the database has no tables) - it has to do a SQLPrepare/SQLExecute before the dead server is seen. Martin -- Martin J. Evans Easysoft Ltd, UK Development