#22309: error accessing django.db.connection.features?
-------------------------------------+-------------------------------------
     Reporter:  lucastan@…           |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  closed
    Component:  Database layer       |                  Version:  1.6
  (models, ORM)                      |               Resolution:  needsinfo
     Severity:  Normal               |             Triage Stage:
     Keywords:                       |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by akaariai):

 We should use temporary tables. They are connection local, and in any case
 using temporary table is a lot better than using normal tables. Temporary
 tables are supported from MySQL 3.23 onwards, so See
 http://dev.mysql.com/doc/refman/4.1/en/create-table.html. The only
 question is if temporary tables have different transaction rules than
 normal tables. I don't see anything indicating that this is the case, but
 then again when dealing with MySQL it wouldn't be a surprise if this is
 the case.

 So, needed here:
   1) check that temp tables work like normal tables when it comes to
 transaction management. My understanding is that the default engine in use
 for MySQL affects if transactions are usable, so the check would be to
 switch to using MyISAM tables as default and then verify that temp table
 gives the same result as normal tables.
   2) create temp table doesn't commit the current transaction - create
 table does. This might change the behavior of the method.
   3) check that this doesn't affect other backends (sqlite seems to use
 the supports_transactions method, too)
   4) write a patch

 Also, the supports_transactions method seems scary. If ran inside
 transaction the end result is silent rollback + switch to autocommit mode.
 So, step 5) is to verify when exactly this method is ran, and also make
 the method assert that no transaction is open when it is ran. If it is
 possible that this method will get ran inside transaction and when not
 testing then we should likely backpatch the fix, too, as this is a clear
 data loss issue in that case.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22309#comment:5>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/076.d1fb29d23364ef365bb096cdbd610ee1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to