Sunday, September 30, 2012

Re: django and mysql versions

On Sun, 30 Sep 2012 09:18:49 -0700 (PDT), Elizabeth Rachel Lemon
<elemon3@gmail.com> declaimed the following in
gmane.comp.python.django.user:

> Is anyone using Django with MySQL 5.5? The page that says "5.0.3 and
> higher" seems to me to imply that this would work, but if MySQLdb is
> required for Django and MySQLdb only supports up to 5.1, then that implies
> that it is at least not supported. Anyone tried it?

The main features that have been added to MySQL are views, triggers,
stored procedures... And "prepared statements".

So far as I know, the only thing MySQLdb doesn't handle is the
"prepared statements" aspect -- it uses the query interface that is
common to all versions: it sends complete text queries. The main place
where the difference would be visible is if one does an .executemany().

The common-to-all versions would issue multiple complete statements,
which need to be parsed and compiled by MySQL /each time/:

insert into thetable (f1, f2, f3) values (v11, v12, v13)
insert into thetable (f1, f2, f3) values (v21, v22, v23)
insert into thetable (f1, f2, f3) values (v31, v32, v33)

Prepared statements would send a parameterized statement to MySQL to
be "compiled"

insert into thetable (f1, f2, f3) values (?1, ?2, ?3)

and then send the values separately, telling MySQL to use the already
compiled statement

stmtref, v11, v12, v13
stmtref, v21, v22, v23
stmtref, v31, v32, v33

I'd find it highly unlikely that MySQL would have /removed/ some
portion of the API that would invalidate pre-existing application code.

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment