Opened 2 years ago

Closed 2 years ago

#20015 closed Bug (fixed)

test_lookup_date_as_str fails under Oracle

Reported by: aaugustin Owned by: shai
Component: Database layer (models, ORM) Version: master
Severity: Release blocker Keywords:
Cc: apollo13, shai@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Change History (5)

comment:1 Changed 2 years ago by apollo13

  • Cc apollo13 added

comment:2 Changed 2 years ago by shai

  • Cc shai@… added

comment:3 Changed 2 years ago by shai

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 Changed 2 years ago by shai

  • Owner changed from nobody to shai
  • Status changed from new to assigned

comment:5 Changed 2 years ago by Shai Berger <shai@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

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