#27632: Oracle backend fails to execute a query with an aggregation that
contains
an expression in the GROUP BY.
-------------------------------------+-------------------------------------
Reporter: Josh Smeaton | Owner: felixxm
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: oracle | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):
* status: closed => new
* has_patch: 1 => 0
* resolution: fixed =>
Comment:
This broke a test on Python 2 (sorry that's not on the PR builder):
{{{
======================================================================
ERROR: setUpClass (expressions_case.tests.CaseExpressionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/tim/code/django/django/test/testcases.py", line 1040, in
setUpClass
cls.setUpTestData()
File "/home/tim/code/django/tests/expressions_case/tests.py", line 27,
in setUpTestData
o = CaseTestModel.objects.create(integer=1, integer2=1, string='1')
File "/home/tim/code/django/django/db/models/manager.py", line 85, in
manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/tim/code/django/django/db/models/query.py", line 392, in
create
obj.save(force_insert=True, using=self.db)
File "/home/tim/code/django/django/db/models/base.py", line 804, in save
force_update=force_update, update_fields=update_fields)
File "/home/tim/code/django/django/db/models/base.py", line 834, in
save_base
updated = self._save_table(raw, cls, force_insert, force_update,
using, update_fields)
File "/home/tim/code/django/django/db/models/base.py", line 920, in
_save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk,
raw)
File "/home/tim/code/django/django/db/models/base.py", line 959, in
_do_insert
using=using, raw=raw)
File "/home/tim/code/django/django/db/models/manager.py", line 85, in
manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/tim/code/django/django/db/models/query.py", line 1032, in
_insert
return query.get_compiler(using=using).execute_sql(return_id)
File "/home/tim/code/django/django/db/models/sql/compiler.py", line
1045, in execute_sql
cursor.execute(sql, params)
File "/home/tim/code/django/django/db/backends/utils.py", line 64, in
execute
return self.cursor.execute(sql, params)
File "/home/tim/code/django/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/tim/code/django/django/db/backends/utils.py", line 64, in
execute
return self.cursor.execute(sql, params)
File "/home/tim/code/django/django/db/backends/oracle/base.py", line
485, in execute
return self.cursor.execute(query, self._param_generator(params))
DatabaseError: ORA-12704: character set mismatch
}}}
The issue looks like the bytestring for `BinaryField` and text string for
`TextField` are treated as equal in Python.
--
Ticket URL: <https://code.djangoproject.com/ticket/27632#comment:9>
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/066.077e9fbd48898881ac15511343906aa2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.