#13906: REPEATABLE READ (as used by default on MySQL) breaks atleast
QuerySet.get_or_create().
-------------------------------------+-------------------------------------
               Reporter:             |          Owner:
  sebastian_noack                    |         Status:  new
                   Type:             |      Component:  Database layer
  Cleanup/optimization               |  (models, ORM)
              Milestone:  1.4        |       Severity:  Normal
                Version:  SVN        |       Keywords:  mysql transaction
             Resolution:             |  isolation
           Triage Stage:  Accepted   |      Has patch:  1
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
Changes (by kmtracey):

 * ui_ux:   => 0


Comment:

 The repeatable read default is tripping up one of our tests:

 {{{
 ./runtests.py --settings=testdb.innodb
 select_for_update.SelectForUpdateTests.test_block
 Creating test database for alias 'default'...
 Creating test database for alias 'other'...
 F
 ======================================================================
 FAIL: test_block (modeltests.select_for_update.tests.SelectForUpdateTests)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/home/kmtracey/django/hg-django/django/test/testcases.py", line
 613, in skip_wrapper
     return test_func(*args, **kwargs)
   File "/home/kmtracey/django/hg-django/django/test/testcases.py", line
 613, in skip_wrapper
     return test_func(*args, **kwargs)
   File "/home/kmtracey/django/hg-
 django/tests/modeltests/select_for_update/tests.py", line 209, in
 test_block
     self.assertEqual('Fred', p.name)
 AssertionError: 'Fred' != u'Reinhardt'

 ----------------------------------------------------------------------
 Ran 1 test in 0.301s

 FAILED (failures=1)
 Destroying test database for alias 'default'...
 Destroying test database for alias 'other'...

 }}}

 It's failing because the test continues to read the already-read value
 even though another transaction has committed a different value. We either
 need to fix the test to avoid this behavior or (better) figure out how to
 fix this problem more globally. Repeatable read does seem to cause more
 problems than anything else, but I'm a little worried about backwards
 incompatibility of changing the default behavior under Django. Hmpf.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/13906#comment:17>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

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

Reply via email to