#34544: models.TextField with =None filter throws Error for Oracle
-------------------------------------+-------------------------------------
Reporter: Michael D. Smith | Owner: Jatin-tec
Type: Bug | Status: closed
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: Oracle isnull lob | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Michael D. Smith):
with nclob also. Do you have MAX_STRING_SIZE = EXTENDED?
{{{
>>> MyTile.objects.create(name='test1',metadata = "x" * 4001)
<MyTile: test1>
>>> MyTile.objects.filter(metadata=None)
Traceback (most recent call last):
File "src/oracledb/impl/base/cursor.pyx", line 397, in
oracledb.base_impl.BaseCursorImpl.fetch_next_row
File "src/oracledb/impl/thin/cursor.pyx", line 110, in
oracledb.thin_impl.ThinCursorImpl._fetch_rows
File "src/oracledb/impl/thin/protocol.pyx", line 382, in
oracledb.thin_impl.Protocol._process_single_message
File "src/oracledb/impl/thin/protocol.pyx", line 383, in
oracledb.thin_impl.Protocol._process_single_message
File "src/oracledb/impl/thin/protocol.pyx", line 376, in
oracledb.thin_impl.Protocol._process_message
oracledb.exceptions.DatabaseError: ORA-06502: PL/SQL: numeric or value
error: character string buffer too small
ORA-06512: at line 1
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Users/rdcrlmds/miniconda3/envs/pdal243/lib/python3.11/site-
packages/django/db/models/query.py", line 374, in __repr__
data = list(self[: REPR_OUTPUT_SIZE + 1])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/rdcrlmds/miniconda3/envs/pdal243/lib/python3.11/site-
packages/django/db/models/query.py", line 398, in __iter__
self._fetch_all()
File "/Users/rdcrlmds/miniconda3/envs/pdal243/lib/python3.11/site-
packages/django/db/models/query.py", line 1881, in _fetch_all
self._result_cache = list(self._iterable_class(self))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/rdcrlmds/miniconda3/envs/pdal243/lib/python3.11/site-
packages/django/db/models/query.py", line 91, in __iter__
results = compiler.execute_sql(
^^^^^^^^^^^^^^^^^^^^^
File "/Users/rdcrlmds/miniconda3/envs/pdal243/lib/python3.11/site-
packages/django/db/models/sql/compiler.py", line 1593, in execute_sql
return list(result)
^^^^^^^^^^^^
File "/Users/rdcrlmds/miniconda3/envs/pdal243/lib/python3.11/site-
packages/django/db/models/sql/compiler.py", line 2091, in cursor_iter
for rows in iter((lambda: cursor.fetchmany(itersize)), sentinel):
File "/Users/rdcrlmds/miniconda3/envs/pdal243/lib/python3.11/site-
packages/django/db/models/sql/compiler.py", line 2091, in <lambda>
for rows in iter((lambda: cursor.fetchmany(itersize)), sentinel):
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/rdcrlmds/miniconda3/envs/pdal243/lib/python3.11/site-
packages/django/db/utils.py", line 97, in inner
with self:
File "/Users/rdcrlmds/miniconda3/envs/pdal243/lib/python3.11/site-
packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/Users/rdcrlmds/miniconda3/envs/pdal243/lib/python3.11/site-
packages/django/db/utils.py", line 98, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/rdcrlmds/miniconda3/envs/pdal243/lib/python3.11/site-
packages/oracledb/cursor.py", line 492, in fetchmany
row = fetch_next_row(self)
^^^^^^^^^^^^^^^^^^^^
File "src/oracledb/impl/base/cursor.pyx", line 397, in
oracledb.base_impl.BaseCursorImpl.fetch_next_row
File "src/oracledb/impl/thin/cursor.pyx", line 110, in
oracledb.thin_impl.ThinCursorImpl._fetch_rows
File "src/oracledb/impl/thin/protocol.pyx", line 382, in
oracledb.thin_impl.Protocol._process_single_message
File "src/oracledb/impl/thin/protocol.pyx", line 383, in
oracledb.thin_impl.Protocol._process_single_message
File "src/oracledb/impl/thin/protocol.pyx", line 376, in
oracledb.thin_impl.Protocol._process_message
django.db.utils.DatabaseError: ORA-06502: PL/SQL: numeric or value error:
character string buffer too small
ORA-06512: at line 1
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34544#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 on the web visit
https://groups.google.com/d/msgid/django-updates/01070187f1b9011b-ace0c797-d25f-4bdd-bf8d-a3eba139511b-000000%40eu-central-1.amazonses.com.