#36189: Oracle Backend with `"use_returning_into": False` Option Fails to 
Retrieve
Last Inserted ID
-------------------------------------+-------------------------------------
     Reporter:  Yeongbae Jeon        |                    Owner:  Amaan-
                                     |  ali03
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  5.1
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Yeongbae Jeon):

 I searched for occurrences of "deprecate" in the Django repository to
 understand how deprecations are handled.

 In django/db/backends/base/operations.py, I found the following code

 {{{
 def field_cast_sql(self, db_type, internal_type):
     """
     Given a column type (e.g. 'BLOB', 'VARCHAR') and an internal type
     (e.g. 'GenericIPAddressField'), return the SQL to cast it before using
     it in a WHERE statement. The resulting string should contain a '%s'
     placeholder for the column being searched against.
     """
     warnings.warn(
         (
             "DatabaseOperations.field_cast_sql() is deprecated use "
             "DatabaseOperations.lookup_cast() instead."
         ),
         RemovedInDjango60Warning,
     )
     return "%s"
 }}}

 In django/db/backends/oracle/base.py, I found the following code, and it
 seems like a good place to add a deprecation warning


 {{{
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     use_returning_into = self.settings_dict["OPTIONS"].get(
         "use_returning_into", True
     )
     self.features.can_return_columns_from_insert = use_returning_into
 }}}

 Before submitting a merge request, I wonder which Django version this
 feature should be deprecated.

 Also, does it matter who submits the merge request, or can anyone do it?
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36189#comment:8>
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 view this discussion visit 
https://groups.google.com/d/msgid/django-updates/010701953ccff0ca-1358b6e7-734c-4477-9a35-b9bb2c26a81b-000000%40eu-central-1.amazonses.com.

Reply via email to