cockroachdb / django-cockroachdb

CockroachDB Backend for Django

Home Page:http://cockroachlabs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unsupported query: mixed type addition in SELECT

timgraham opened this issue · 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"

cockroachdb/cockroach#16303 suggests this is by design and may not be fixed. Thoughts @rafiss?