From a9b43edde24e6bb2caa82864d9b8d865b2fea113 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sun, 14 Aug 2005 23:59:29 +0000 Subject: [PATCH] Fixed #316 -- Changed MySQL backend to disregard warnings git-svn-id: http://code.djangoproject.com/svn/django/trunk@494 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/db/backends/mysql.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/django/core/db/backends/mysql.py b/django/core/db/backends/mysql.py index 4a54a277e4..cdcaa32bc3 100644 --- a/django/core/db/backends/mysql.py +++ b/django/core/db/backends/mysql.py @@ -9,6 +9,7 @@ from django.core.db.dicthelpers import * import MySQLdb as Database from MySQLdb.converters import conversions from MySQLdb.constants import FIELD_TYPE +from MySQLdb.cursors import CursorNW # Ignores MySQL warnings. import types DatabaseError = Database.DatabaseError @@ -30,7 +31,8 @@ class DatabaseWrapper: from django.conf.settings import DATABASE_USER, DATABASE_NAME, DATABASE_HOST, DATABASE_PASSWORD, DEBUG if self.connection is None: self.connection = Database.connect(user=DATABASE_USER, db=DATABASE_NAME, - passwd=DATABASE_PASSWORD, host=DATABASE_HOST, conv=django_conversions) + passwd=DATABASE_PASSWORD, host=DATABASE_HOST, conv=django_conversions, + cursorclass=CursorNW) if DEBUG: return base.CursorDebugWrapper(self.connection.cursor(), self) return self.connection.cursor()