Skip to content

Commit

Permalink
Fixed #2827 -- Reverted [3855]
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
adrianholovaty committed Sep 26, 2006
1 parent b019331 commit 38d80f8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
1 change: 0 additions & 1 deletion AUTHORS
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ answer newbie questions, and generally made Django that much better:
Eric Moritz <http://eric.themoritzfamily.com/> Eric Moritz <http://eric.themoritzfamily.com/>
Robin Munn <http://www.geekforgod.com/> Robin Munn <http://www.geekforgod.com/>
Nebojša Dorđević Nebojša Dorđević
Fraser Nevett <mail@nevett.org>
Sam Newman <http://www.magpiebrain.com/> Sam Newman <http://www.magpiebrain.com/>
Neal Norwitz <nnorwitz@google.com> Neal Norwitz <nnorwitz@google.com>
oggie rob <oz.robharvey@gmail.com> oggie rob <oz.robharvey@gmail.com>
Expand Down
9 changes: 1 addition & 8 deletions django/core/management.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -820,8 +820,7 @@ def get_validation_errors(outfile, app=None):
validates all models of all installed apps. Writes errors, if any, to outfile. validates all models of all installed apps. Writes errors, if any, to outfile.
Returns number of errors. Returns number of errors.
""" """
from django.conf import settings from django.db import models
from django.db import models, connection
from django.db.models.loading import get_app_errors from django.db.models.loading import get_app_errors
from django.db.models.fields.related import RelatedObject from django.db.models.fields.related import RelatedObject


Expand Down Expand Up @@ -863,12 +862,6 @@ def get_validation_errors(outfile, app=None):
if f.db_index not in (None, True, False): if f.db_index not in (None, True, False):
e.add(opts, '"%s": "db_index" should be either None, True or False.' % f.name) e.add(opts, '"%s": "db_index" should be either None, True or False.' % f.name)


# Check that maxlength <= 255 if using older MySQL versions.
if settings.DATABASE_ENGINE == 'mysql':
db_version = connection.get_server_version()
if db_version < (5, 0, 3) and isinstance(f, (models.CharField, models.CommaSeparatedIntegerField, models.SlugField)) and f.maxlength > 255:
e.add(opts, '"%s": %s cannot have a "maxlength" greater than 255 when you are using a version of MySQL prior to 5.0.3 (you are using %s).' % (f.name, f.__class__.__name__, '.'.join(str(n) for n in db_version[:3])))

# Check to see if the related field will clash with any # Check to see if the related field will clash with any
# existing fields, m2m fields, m2m related objects or related objects # existing fields, m2m fields, m2m related objects or related objects
if f.rel: if f.rel:
Expand Down
11 changes: 0 additions & 11 deletions django/db/backends/mysql/base.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from MySQLdb.converters import conversions from MySQLdb.converters import conversions
from MySQLdb.constants import FIELD_TYPE from MySQLdb.constants import FIELD_TYPE
import types import types
import re


DatabaseError = Database.DatabaseError DatabaseError = Database.DatabaseError


Expand All @@ -25,8 +24,6 @@
FIELD_TYPE.TIME: util.typecast_time, FIELD_TYPE.TIME: util.typecast_time,
}) })


server_version_re = re.compile('[.-]')

# This is an extra debug layer over MySQL queries, to display warnings. # This is an extra debug layer over MySQL queries, to display warnings.
# It's only used when DEBUG=True. # It's only used when DEBUG=True.
class MysqlDebugWrapper: class MysqlDebugWrapper:
Expand Down Expand Up @@ -114,14 +111,6 @@ def close(self):
self.connection.close() self.connection.close()
self.connection = None self.connection = None


def get_server_version(self):
if not self.server_version:
if not self._valid_connection():
self.cursor()
version = server_version_re.split(self.connection.get_server_info())
self.server_version = tuple([int(x) for x in version[:3]]) + tuple(version[3:])
return self.server_version

supports_constraints = True supports_constraints = True


def quote_name(name): def quote_name(name):
Expand Down

0 comments on commit 38d80f8

Please sign in to comment.