MySQLdb reconnect patch is harmful

Bug #163184 reported by Gustavo Niemeyer
2
Affects Status Importance Assigned to Milestone
python-mysqldb (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: python-mysqldb

Ubuntu has inherited a patch from Debian in Python's MySQLdb package which
is quite harmful to any application which needs transactional behavior.

Here is a comment in Storm which explains the problem:

        # Here is another sad story about bad transactional behavior. MySQL
        # offers a feature to automatically reconnect dropped connections.
        # What sounds like a dream, is actually a nightmare for anyone who
        # is dealing with transactions. When a reconnection happens, the
        # currently running transaction is transparently rolled back, and
        # everything that was being done is lost, without notice. Not only
        # that, but the connection may be put back in AUTOCOMMIT mode, even
        # when that's not the default MySQLdb behavior. The MySQL developers
        # quickly understood that this is a terrible idea, and removed the
        # behavior in MySQL 5.0.3. Unfortunately, Debian and Ubuntu still
        # have a patch right now which *reenables* that behavior by default
        # even past version 5.0.3.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-mysqldb - 1.2.2-5ubuntu1

---------------
python-mysqldb (1.2.2-5ubuntu1) hardy; urgency=low

  * Disable the 02_reconnect patch. LP: #64270, #163184.

    Comment in Storm which explains the problem:

        # Here is another sad story about bad transactional behavior. MySQL
        # offers a feature to automatically reconnect dropped connections.
        # What sounds like a dream, is actually a nightmare for anyone who
        # is dealing with transactions. When a reconnection happens, the
        # currently running transaction is transparently rolled back, and
        # everything that was being done is lost, without notice. Not only
        # that, but the connection may be put back in AUTOCOMMIT mode, even
        # when that's not the default MySQLdb behavior. The MySQL developers
        # quickly understood that this is a terrible idea, and removed the
        # behavior in MySQL 5.0.3. Unfortunately, Debian and Ubuntu still
        # have a patch right now which *reenables* that behavior by default
        # even past version 5.0.3.

 -- Matthias Klose <email address hidden> Wed, 09 Apr 2008 19:19:42 +0000

Changed in python-mysqldb:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.