#7411: Saving db object while iterating over a queryset larger than
ITER_CHUNK_SIZE breaks with sqlite
---------------------------------------+------------------------------------
          Reporter:  jenan             |         Owner:  mtredinnick            
    
            Status:  reopened          |     Milestone:                         
    
         Component:  Database wrapper  |       Version:  SVN                    
    
        Resolution:                    |      Keywords:  sqlite, queryset, 
iteration
             Stage:  Accepted          |     Has_patch:  0                      
    
        Needs_docs:  0                 |   Needs_tests:  0                      
    
Needs_better_patch:  0                 |  
---------------------------------------+------------------------------------
Changes (by Dave Smith <[EMAIL PROTECTED]>):

  * status:  closed => reopened
  * resolution:  fixed =>

Comment:

 On OSX Leopard (Python 2.5.1, SQLite3 3.4), r7926 introduces the following
 failure not present in r7925:

 {{{
 Updated to revision 7926.
 Macintosh-8:tests dws$ python runtests.py --settings=test-settings
 ======================================================================
 FAIL: Doctest: regressiontests.queries.models.__test__.API_TESTS
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/Library/Python/2.5/site-packages/django/test/_doctest.py", line
 2180, in runTest
     raise self.failureException(self.format_failure(new.getvalue()))
 AssertionError: Failed doctest test for
 regressiontests.queries.models.__test__.API_TESTS
   File
 "/Users/dws/src/django_dev/tests/regressiontests/queries/models.py", line
 unknown line number, in API_TESTS

 ----------------------------------------------------------------------
 File "/Users/dws/src/django_dev/tests/regressiontests/queries/models.py",
 line ?, in regressiontests.queries.models.__test__.API_TESTS
 Failed example:
     for i, obj in enumerate(Number.objects.all()):
         obj.save()
         if i > 10: break
 Exception raised:
     Traceback (most recent call last):
       File "/Library/Python/2.5/site-packages/django/test/_doctest.py",
 line 1267, in __run
         compileflags, 1) in test.globs
       File "<doctest
 regressiontests.queries.models.__test__.API_TESTS[217]>", line 2, in
 <module>
         obj.save()
       File "/Library/Python/2.5/site-packages/django/db/models/base.py",
 line 278, in save
         self.save_base()
       File "/Library/Python/2.5/site-packages/django/db/models/base.py",
 line 347, in save_base
         transaction.commit_unless_managed()
       File "/Library/Python/2.5/site-packages/django/db/transaction.py",
 line 140, in commit_unless_managed
         connection._commit()
       File "/Library/Python/2.5/site-
 packages/django/db/backends/__init__.py", line 20, in _commit
         return self.connection.commit()
     OperationalError: SQL logic error or missing database


 ----------------------------------------------------------------------
 Ran 363 tests in 220.245s

 FAILED (failures=1)
 }}}


 My test-settings.py is
 {{{
 DATABASE_ENGINE = 'sqlite3'
 DATABASE_NAME = '/tmp/django-test'
 ROOT_URLCONF = ''
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7411#comment:7>
Django Code <http://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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to