[Django] #35225: Tests of ordering by JSON field fail in Oracle 21c

10 views
Skip to first unread message

Django

unread,
Feb 17, 2024, 8:12:18 AM2/17/24
to django-...@googlegroups.com
#35225: Tests of ordering by JSON field fail in Oracle 21c
-------------------------------------+-------------------------------------
Reporter: raydeal | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database | Version: 5.0
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
There are 2 tests that fail in Oracle 21c.


{{{
ERROR [0.011s]: test_order_by_key
(db_functions.comparison.test_json_object.JSONObjectTests.test_order_by_key)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tests/django/tests/db_functions/comparison/test_json_object.py",
line 100, in test_order_by_key
self.assertQuerySetEqual(qs, Author.objects.order_by("alias"))
File "/tests/django/django/test/testcases.py", line 1228, in
assertQuerySetEqual
return self.assertEqual(list(items), values, msg=msg)
^^^^^^^^^^^
File "/tests/django/django/db/models/query.py", line 400, in __iter__
self._fetch_all()
File "/tests/django/django/db/models/query.py", line 1928, in _fetch_all
self._result_cache = list(self._iterable_class(self))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tests/django/django/db/models/query.py", line 123, in __iter__
for row in compiler.results_iter(results):
File "/tests/django/django/db/models/sql/compiler.py", line 1508, in
apply_converters
value = converter(value, expression, connection)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tests/django/django/db/backends/oracle/operations.py", line 246,
in convert_textfield_value
value = value.read()
^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/oracledb/lob.py", line
130, in read
return self._impl.read(offset, amount)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "src/oracledb/impl/thin/lob.pyx", line 254, in
oracledb.thin_impl.ThinLobImpl.read
File "src/oracledb/impl/thin/lob.pyx", line 197, in
oracledb.thin_impl.ThinLobImpl._process_message
File "src/oracledb/impl/thin/protocol.pyx", line 425, in
oracledb.thin_impl.Protocol._process_single_message
File "src/oracledb/impl/thin/protocol.pyx", line 426, in
oracledb.thin_impl.Protocol._process_single_message
File "src/oracledb/impl/thin/protocol.pyx", line 419, in
oracledb.thin_impl.Protocol._process_message
oracledb.exceptions.DatabaseError: ORA-24826: value LOB no longer
available
Help: https://docs.oracle.com/error-help/db/ora-24826/
}}}


{{{
ERROR [0.010s]: test_order_by_nested_key
(db_functions.comparison.test_json_object.JSONObjectTests.test_order_by_nested_key)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tests/django/tests/db_functions/comparison/test_json_object.py",
line 106, in test_order_by_nested_key
self.assertQuerySetEqual(qs, Author.objects.order_by("-alias"))
File "/tests/django/django/test/testcases.py", line 1228, in
assertQuerySetEqual
return self.assertEqual(list(items), values, msg=msg)
^^^^^^^^^^^
File "/tests/django/django/db/models/query.py", line 400, in __iter__
self._fetch_all()
File "/tests/django/django/db/models/query.py", line 1928, in _fetch_all
self._result_cache = list(self._iterable_class(self))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tests/django/django/db/models/query.py", line 123, in __iter__
for row in compiler.results_iter(results):
File "/tests/django/django/db/models/sql/compiler.py", line 1508, in
apply_converters
value = converter(value, expression, connection)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tests/django/django/db/backends/oracle/operations.py", line 246,
in convert_textfield_value
value = value.read()
^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/oracledb/lob.py", line
130, in read
return self._impl.read(offset, amount)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "src/oracledb/impl/thin/lob.pyx", line 254, in
oracledb.thin_impl.ThinLobImpl.read
File "src/oracledb/impl/thin/lob.pyx", line 197, in
oracledb.thin_impl.ThinLobImpl._process_message
File "src/oracledb/impl/thin/protocol.pyx", line 425, in
oracledb.thin_impl.Protocol._process_single_message
File "src/oracledb/impl/thin/protocol.pyx", line 426, in
oracledb.thin_impl.Protocol._process_single_message
File "src/oracledb/impl/thin/protocol.pyx", line 419, in
oracledb.thin_impl.Protocol._process_message
oracledb.exceptions.DatabaseError: ORA-24826: value LOB no longer
available
Help: https://docs.oracle.com/error-help/db/ora-24826/
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35225>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 17, 2024, 9:01:30 AM2/17/24
to django-...@googlegroups.com
#35225: Tests of ordering by JSON field fail in Oracle 21c
-------------------------------------+-------------------------------------
Reporter: raydeal | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mariusz Felisiak):

Interesting they pass on Oracle 23c.
--
Ticket URL: <https://code.djangoproject.com/ticket/35225#comment:1>

Django

unread,
Feb 19, 2024, 2:41:59 AM2/19/24
to django-...@googlegroups.com
#35225: Tests of ordering by JSON field fail in Oracle 21c
-------------------------------------+-------------------------------------
Reporter: raydeal | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* resolution: => needsinfo
* status: new => closed

Comment:

I don't think you've explained the issue in enough detail to confirm a bug
in Django. This looks like an issue in `python-oracledb`, some related
library, your local installation, or a bug in Oracle 21c itself. As far as
I'm aware, Django doesn't do anything specific to free LOBs. Please reopen
the ticket if you can debug your issue and provide details about why and
where Django is at fault.
--
Ticket URL: <https://code.djangoproject.com/ticket/35225#comment:2>
Reply all
Reply to author
Forward
0 new messages