Opened 12 years ago

Closed 12 years ago

#20015 closed Bug (fixed)

test_lookup_date_as_str fails under Oracle

Reported by: Aymeric Augustin Owned by: Shai Berger
Component: Database layer (models, ORM) Version: dev
Severity: Release blocker Keywords:
Cc: Florian Apolloner, shai@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Change History (5)

comment:1 by Florian Apolloner, 12 years ago

Cc: Florian Apolloner added

comment:2 by Shai Berger, 12 years ago

Cc: shai@… added

comment:3 by Shai Berger, 12 years ago

Reference to anybody working on this: the user code is

Book.objects.filter(pubdate__startswith='2005')

and the generated query is

...
WHERE "SHARED_MODELS_BOOK"."PUBDATE" LIKE TRANSLATE(TO_TIMESTAMP(:arg0, 'YYYY-MM-DD HH24:MI:SS.FF') USING NCHAR_CS) ESCAPE TRANSLATE('\' USING NCHAR_CS)

That is, where the user code expects dates to be translated to strings, the backend tries to translate the string to a date in the middle of all the string translation operations.

comment:4 by Shai Berger, 12 years ago

Owner: changed from nobody to Shai Berger
Status: newassigned

comment:5 by Shai Berger <shai@…>, 12 years ago

Resolution: fixed
Status: assignedclosed

In 8fd40b9ae783614658f6e0ca7af7f2faab0c48fc:

Fixed #20015 -- datestartswith('2008') fails under Oracle

Removed the explicit casting of strings to dates

Note: See TracTickets for help on using tickets.
Back to Top