From 34ad168b73bb2d700e71c697bd856ee07d0bfc21 Mon Sep 17 00:00:00 2001 From: adustman Date: Fri, 31 Dec 2004 22:34:11 +0000 Subject: [PATCH] Very minor DB-API compliance fixes. --- MySQLdb/MySQLdb/cursors.py | 2 +- MySQLdb/_mysql.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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);