#23061: Oracle SQL compiler adding outer pagination selects causing ORA-00907:
missing right parenthesis when used with select_for_update.
-------------------------------------+-------------------------------------
     Reporter:  michael.miller@…     |                    Owner:  shai
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  1.7-rc-1
  (models, ORM)                      |               Resolution:
     Severity:  Release blocker      |             Triage Stage:  Ready for
     Keywords:  oracle sql compiler  |  checkin
  ORA-00907                          |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by shai):

 Replying to [comment:11 apollo13]:
 > Can't we just revert the fix for #6785?

 I'd like to have better reasons for reverting it than "Oracle is retarded
 and the Django backend hasn't managed to work around that."

 Replying to [comment:12 michael.miller@…]:
 > I'm not excited by all my gets now being wrapped in two additional
 selects. Our DBAs probably won't be either. Is it possible to create a db
 back end flag for slicing get results and have it turned off on Oracle.

 I think it is better to do this, not via flags, but rather by providing a
 hook for the backend. That way, the Oracle backend (and also others) could
 implement #6785 by special fetches instead of slicing the query.

 The kind of hook I have in mind is: Replace the line in `QuerySet.get()`
 which slices the query with code which gets a compiler and calls a new
 method on it, `compiler.prepare_for_get(query)`.  The default
 implementation of `prepare_for_get()` will slice the query, but the Oracle
 one will just mark it as a `get`. Then, the backend, when executing the
 query and fetching its results, will know to fetch only up to 21 rows (how
 exactly this part works is still not clear to me, because at that point
 the backend only gets sql, but we'll figure it out).

 My capacity for working on any of this until the end of next week is quite
 limited, as I am on a family vacation.

 > If not the patch should work

 All of the proposed solutions so far still leave the original deep problem
 unsolved: Sliced for-update queries do not work on Oracle. However, this
 has probably been the case for a very long time, and I don't see it
 reported, so apparently that should not be a release blocker. Thanks for
 validating that the smaller issue of `get()` is indeed the only problem
 for you.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/23061#comment:13>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/084.70783917ef521690c065fab6c25c0707%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to