Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#3747 closed (fixed)

Changeset [4724] MySQLdb versioncheck not working.

Reported by: derelm Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

# django/db/backends/mysql/base.py
import MySQLdb as Database
#[...]
if Database.version_info < (1,2,1,'final',2):
	    raise ImportError, "MySQLdb-1.2.1p2 or newer is required; you have %s" % MySQLdb.__version__

Debian Sarge comes with MySQLdb 1.2.1.g2 but the check effectively doesn't kick in.

>>> (1,2,1,'gamma',2) < (1,2,1,'final',2)
False

Also MySQLdb has been imported as Database so the Error raised needs to be

raise ImportError, "MySQLdb-1.2.1p2 or newer is required; you have %s" % Database.__version__

Change History (9)

comment:1 by Simon G. <dev@…>, 17 years ago

Summary: Changeset [4724] MySQLdb versioncheck not workingChangeset [4724] MySQLdb versioncheck not working.
Triage Stage: UnreviewedAccepted

Design Decision needed re: version support (we should prob. support a well-established os like sarge, but what are the differences between MySQLdb gamma and final)?

The import error is ready to be checked in.

comment:2 by Simon G. <dev@…>, 17 years ago

I've looked around sourceforge for MySQLdb, but can't see any obvious way of finding the differences between 1.2.1 gamma and 1.2.1 final. I doubt, however, that there's any massive changes between a gamma release and a final release.

comment:3 by derelm, 17 years ago

With gamma i could not specify DATABASE_OPTIONS = dict(charset="utf8") - that would raise an error. (suggested to fix my problems in #2635). So there seem to be enough differences to cause problems with Django.

comment:4 by Malcolm Tredinnick, 17 years ago

The problem that original forced us to recommend the upgrade to 1.2.1p2 or later (#3279) was only fixed in that precise version. So no earlier versions are recommended for production (and hence any) use with Django. I'm about to check in a version check that knows the difference between "gamma" and "final, 1" and "final, 2".

comment:5 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [4751]) Fixed #3747 -- Added a stricter MySQLdb version check so that (1, 2, 1,
'final', 2) passes and (1, 2, 1, 'gamma') does not. Also fixed a problem in the
error reporting when the check fails.

comment:6 by anonymous, 17 years ago

FWIW, this change broke my sites that are hosted on Dreamhost, as they have MySQL 1.2.1g3. Not suggesting it should be undone, just noting it, as I suspect there will be a lot of people wondering what happened.

comment:7 by jeff@…, 17 years ago

Sorry, I didn't mean to post that as anonymous. That was from me, Jeff Croft.

comment:8 by Malcolm Tredinnick, 17 years ago

Jeff: that's the problem (not Dreamhost in particular, but the breakage in general) and why we had a bit of a discussion about this on django-dev. We're going to somewhat damned whichever way we go, unfortunately. :-(

comment:9 by anonymous, 17 years ago

Fair enough. Sorry I missed the discussion on django-dev. No big problem for me, just had to rollback that one file on Dreamhost. :)

Note: See TracTickets for help on using tickets.
Back to Top