Issue #44 resolved

test_mp_proxy_delete_* tests fail with mysql, Django 1.3 and python 2.4, 2.5 and 2.6

Gustavo Picon
repo owner created an issue

(tox rocks, and at first glance this seems like a bug in Django 1.3)

All tests pass with Django 1.3 and Python 2.7.

. {{{


[TOX] py24django10: commands succeeded [TOX] py24django11: commands succeeded [TOX] py24django12: commands succeeded [TOX] ERROR: py24django13: commands failed [TOX] py25django10: commands succeeded [TOX] py25django11: commands succeeded [TOX] py25django12: commands succeeded [TOX] ERROR: py25django13: commands failed [TOX] py26django10: commands succeeded [TOX] py26django11: commands succeeded [TOX] py26django12: commands succeeded [TOX] ERROR: py26django13: commands failed [TOX] py27django10: commands succeeded [TOX] py27django11: commands succeeded [TOX] py27django12: commands succeeded [TOX] py27django13: commands succeeded [TOX] docs: commands succeeded }}}

Attached: test errors for MySQL, Python 2.5 and Django 1.3 (both Python 2.4 and Python 2.6 have identical errors).

(EDIT: updated title and description, Django 1.3 final has the same problem)

Comments (6)

  1. Anonymous

    Hi, any news about this bug? It seems to be coherent that MP_Node.delete() does not delete leve recursive anymore?

    Thanks and best regards, Bernhard

  2. Gustavo Picon reporter
    • changed status to open

    This is a bug in Django, fixed in their 1.4 release. Thanks to the magic of hg bisect I found the changeset that broke things:

    And the changeset that fixed them back.

    The bug happens when these conditions are met:

    • Django 1.3.X is used
    • Proxy models are used (so most people shouldn't be affected by this bug).
    • MySQL is being used.

    As it turns out, there is some added complexity in the Django codebase because MySQL, even while using InnoDB, doesn't support deferred constraint checks, completely shattering the little confidence I still had in this database.

    Exploring solutions for this problem:

    I can't really do much in treebeard about this. I _could_ monkeypatch django, but that would involve:

    • Monkeypatching Django, and
    • Monkeypatching.

    My proposed solution (unless somebody has a better idea) is to either:

    • Use a real database, like PostgreSQL
    • Use Django 1.4

    What I'll probably do (again, unless somebody comes with a good solution) is:

    • Skip tests for node deletion with proxy models in MySQL when using Django 1.3, and
    • Add a warning in the documentation.
  3. Log in to comment