On Sat, 2006-03-04 at 11:25 +0800, Russell Keith-Magee wrote:
> On 3/4/06, Luke Plant <[EMAIL PROTECTED]> wrote:
> > Russell (I think this is your area),
> >
> > I found another bug in delete().  I eventually managed to get it down to
> > the attached example, in the same format as the existing model tests.
> 
> Thanks for narrowing this one down - I'll have a look at it.
> 
> > Can anyone else confirm?  If
> > not I've got bizarre hardware failure -- either my computer or my
> > brain.
> 
> I get the same behaviour (postgres also). Must be a neutrino in the
> flux matrix. :-)

OK, it's weirder than you think, though. I get the same failure whether
I run all the tests or only Luke's tests using postgreSQL (and
everything passes with SQLite).

But I can also generate different results depending upon whether I run

        python runtests.py --settings=settings luke

or

        python -i runtests.py --settings=settings luke

(I often use the latter case so that I can inspect things like
db.connection.queries).

When I put print statements into db.backend.util to see what is
happening, I see the following SQL going to PostgreSQL in the first
case:

SELECT
"luke_polloption"."id","luke_polloption"."text","luke_polloption"."poll_id" 
FROM "luke_polloption" WHERE ("luke_polloption"."poll_id" = 1)
DELETE FROM "luke_message" WHERE "id" IN (1)
DELETE FROM "luke_poll" WHERE "id" IN (1)

        (...and then back to SELECT statements for the next part of the
        test)

and this SQL in the second case:

SELECT
"luke_polloption"."id","luke_polloption"."text","luke_polloption"."poll_id" 
FROM "luke_polloption" WHERE ("luke_polloption"."poll_id" = 1)
DELETE FROM "luke_message" WHERE "id" IN (1)
DELETE FROM "luke_polloption" WHERE "id" IN (2,1)
DELETE FROM "luke_poll" WHERE "id" IN (1)
DELETE FROM "luke_member" WHERE "name" IN (Joe)

        (... and then select statements)

Obviously, the latter is correct and PostgreSQL barfs on the former,
complaining about foreign key violations. But the first case is
completely reproducible on my system.

> 
> This is starting to sound like there is something relying upon
> insertion order in a dictionary...
> 
> > Looking at compare_models() makes my head hurt (especially at this time
> > of night), so I'm hoping someone else will be able to work this one
> > out!
> 
> Its a long weekend here in Western Australia, and I was looking for
> something to do... looks like something found me :-)

Russ, I'm sitting on IRC as malcolmt (and I'm in Sydney, so our
timezones overlap nicely) and should be for most of the weekend, so if
you need more information about the above, ping me.

Cheers,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to