Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.6.3
-
None
-
Debian GNU/Linux, testing, 6.0, amd64 architecture.
Description
Hello.
I'm using Qt, version 4.6.3, and QMYSQL driver.
My application is connecting to database once, when constructing database worker object.
When connection is lost (for ex. MySQL server restarted), QSqlDatabase methods isOpen(), isValid() return TRUE instead of FALSE.
lastError() returns QSqlError::NoError, even after unsuccessfully executing query (empty QSqlQuery as the result).
The only solution I found was executing simple "SELECT 1;" and checking if query.first() returns false and invoking QSqlDatabase::open() again.
But this solutions requires running additional query every time.
Sorry if this problem has been fixed in later Qt versions, but I'm not able to check that at the moment, or if I'm misinterpreting something.
Best regards,
Grzegorz B.