[mythtv-commits] mythtv/master commit: dd2d7a14d by Michael T. Dean (sphery)

MythTV noreply at mythtv.org
Wed Jul 27 18:53:50 UTC 2011


      Author:  Michael T. Dean <mdean at mythtv.org>
 Change Date:  2011-07-27T11:52:17-07:00
   Push Date:  2011/07/27 11:53:43 -0700
  Repository:  mythtv
      Branch:  master
New Revision:  dd2d7a14d10c55f8bc8d12e944adb3b3c9ac8cea
   Changeset:  https://github.com/MythTV/mythtv/commit/dd2d7a14d

Log:

Enable automatic reconnection for MySQL connections.

After 155138a127 changed the minimum supported Qt version to 4.6, we now
have support for MYSQL_OPT_RECONNECT in
QSqlDatabase::setConnectOptions().

Note that before MySQL 5, reconnecting connections were the default in
the MySQL C API (so, were always enabled for the Qt-MySQL driver).
Unfortunately, depending on how the application is written,
reconnections may cause issues (since reconnections have effects on
transactions, table locks, temporary tables, session and user variables,
prepared statements, and such), so MySQL 5.0.3 changed the default to
disable automatic reconnections, and MySQL 5.0.13 added
MYSQL_OPT_RECONNECT to make reconnection an application-controllable
option.  Since the Qt-MySQL driver didn't have support for specifying
MYSQL_OPT_RECONNECT, it was impossible to get reconnecting connections
with MySQL 5.0.3+ in Qt applications.  Finally in Qt4.6, Qt devs added
support for specifying MYSQL_OPT_RECONNECT, so we can re-enable
automatic reconnect.

Thanks to David Edwards for the reminder to set this option.

Refs #9704, #9773, #9792.

Modified:

   mythtv/libs/libmythbase/mythdbcon.cpp



More information about the mythtv-commits mailing list