django-cockroachdb icon indicating copy to clipboard operation
django-cockroachdb copied to clipboard

Unsupported query: mixed type addition in SELECT

Open timgraham opened this issue 5 years ago • 1 comments

For example:

======================================================================
ERROR: test_mixed_type_annotation_numbers (annotations.tests.NonAggregateAnnotationTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
psycopg2.errors.InvalidParameterValue: unsupported binary operator: <int> + <float>

Is there a plan to add support?

The SQL adds integer and float columns in a SELECT clause:

SELECT ... ("annotations_book"."pages" + "annotations_book"."rating") AS "combined"
FROM "annotations_book"

timgraham avatar Oct 09 '19 15:10 timgraham

https://github.com/cockroachdb/cockroach/issues/16303 suggests this is by design and may not be fixed. Thoughts @rafiss?

timgraham avatar Nov 06 '20 23:11 timgraham