diff --git a/MySQLdb/MySQLdb/cursors.py b/MySQLdb/MySQLdb/cursors.py index f39124a..bf69f90 100644 --- a/MySQLdb/MySQLdb/cursors.py +++ b/MySQLdb/MySQLdb/cursors.py @@ -29,7 +29,7 @@ class BaseCursor(object): self.connection = connection self.description = None self.rowcount = -1 - self.arraysize = 100 + self.arraysize = 1 self._executed = None self.lastrowid = None self.messages = [] diff --git a/MySQLdb/_mysql.c b/MySQLdb/_mysql.c index 68ff2f8..647f7e6 100644 --- a/MySQLdb/_mysql.c +++ b/MySQLdb/_mysql.c @@ -609,6 +609,10 @@ _mysql_ConnectionObject_close( mysql_close(&(self->connection)); Py_END_ALLOW_THREADS self->open = 0; + } else { + PyErr_SetString(_mysql_ProgrammingError, + "closing a closed connection"); + return NULL; } _mysql_ConnectionObject_clear(self); Py_INCREF(Py_None);