Opened 18 years ago

Closed 18 years ago

#3464 closed (fixed)

Oracle representation of the IPAddressField

Reported by: benk Owned by: Jacob
Component: Database layer (models, ORM) Version: other branch
Severity: Keywords: Oracle, IPAddessField
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The IPAddressField is defined in creation.py as CHAR(15). To my understanding this means that all values in that column will be allocated enough memory to store 15 characters of data regardless if the string being stored is in fact 15 characters long.

I have discovered that for an IP address such as 192.168.1.210 where there are only 13 characters, the data base will pad out my IP address with space characters so that it becomes '192.168.1.210 '. This causes problems when performing searches unless I use 'istartswith'.

Change History (3)

comment:1 by Chris Beaven, 18 years ago

Should more than likely be VARCHAR then. Can someone investigate and report back to this ticket?

comment:2 by benk, 18 years ago

There may be database optimizations available when using CHAR(15) if the size of the data is known. In my opinion the issue is that the database appends trailing spaces which meaning that text comparisons will fail. Perhaps there is an oracle operator that will strip trailing spaces?

comment:3 by Matt Boersma, 18 years ago

Component: UncategorizedDatabase wrapper
Resolution: fixed
Status: newclosed
Version: SVNother branch

This was fixed in [5001] by changing the column type to VARCHAR2(15).

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