Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#10071 closed (fixed)

month and day lookup arguments should be integers

Reported by: Leo Soto M. Owned by: nobody
Component: Database layer (models, ORM) Version: 1.0
Severity: Keywords: jython
Cc: Jacob Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

On [8131] we forgot to normalize month and day lookups to be passed as a consistent type to the backend. Later, on [8494] and [8526] they were normalized as unicode, apparently to avoid problems with SQLite.

This is a problem for backends which are strict in terms of the argument data types. Specifically, on PostgreSQL and JDBC, it doesn't work if you compare the year of a date column against an string. Also, I don't see how to fix the problem on the backend layer, as it doesn't seem to have a chance to do the needed type conversion.

Now, considering than months and day numbers are, well, numbers, int sounds like a better type than unicode for interfacing with the backend. The attached patch does this change, without breaking the sqlite3 backend.

Attachments (2)

month_and_day_lookups_as_ints.diff (1.0 KB ) - added by Leo Soto M. 16 years ago.
10071-month_day_weekday_lookups_as_ints-r10454.diff (1.5 KB ) - added by Ramiro Morales 16 years ago.
Updated Leo's patch to post-week_day lookup adition (r9818)

Download all attachments as: .zip

Change History (9)

by Leo Soto M., 16 years ago

comment:2 by Jacob, 16 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:3 by Russell Keith-Magee, 16 years ago

Component: UncategorizedDatabase layer (models, ORM)

comment:4 by Leo Soto M., 16 years ago

Cc: Jacob added

Just a reminder that this is an important bug on jython and should be backported to the next 1.0.X release

by Ramiro Morales, 16 years ago

Updated Leo's patch to post-week_day lookup adition (r9818)

comment:5 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: newclosed

(In [10530]) Fixed #10071 -- Changed some internal database data representations.

We now pass numbers used in data queries as actualy numbers (integers) to the
database backends, rather than string forms. This is easier for some of the
less flexible backeds.

Based on a patch from Leo Soto and Ramiro Morales.

comment:6 by Malcolm Tredinnick, 16 years ago

(In [10531]) [1.0.X] Fixed #10071 -- Changed some internal database data representations.

We now pass numbers used in data queries as actualy numbers (integers) to the
database backends, rather than string forms. This is easier for some of the
less flexible backeds.

Patch from Leo Soto.

Backport of r10530 from trunk.

comment:7 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

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