Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #316 -- Changed MySQL backend to disregard warnings

git-svn-id: http://code.djangoproject.com/svn/django/trunk@494 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a9b43edde24e6bb2caa82864d9b8d865b2fea113 1 parent 54f9389
@adrianholovaty adrianholovaty authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 django/core/db/backends/mysql.py
View
4 django/core/db/backends/mysql.py
@@ -9,6 +9,7 @@
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 @@ def cursor(self):
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()
Please sign in to comment.
Something went wrong with that request. Please try again.