diff MySQLdb/connections.py @ 72:c0c00294239b MySQLdb

Check in some old changes
author adustman
date Thu, 18 Feb 2010 23:47:51 +0000
parents 98d968f5af11
children 80164eb2f090
line wrap: on
line diff
--- a/MySQLdb/connections.py	Tue Dec 08 00:20:52 2009 +0000
+++ b/MySQLdb/connections.py	Thu Feb 18 23:47:51 2010 +0000
@@ -169,9 +169,12 @@
         self.messages = []
     
     def autocommit(self, do_autocommit):
+        self._autocommit = do_autocommit
         return self._db.autocommit(do_autocommit)
 
     def ping(self, reconnect=False):
+        if reconnect and not self._autocommit:
+            raise ProgrammingError("autocommit must be enabled before enabling auto-reconnect; consider the consequences")
         return self._db.ping(reconnect)
     
     def commit(self):