Opened 11 years ago

Closed 11 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: UI/UX:


The IPAddressField is defined in 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 where there are only 13 characters, the data base will pad out my IP address with space characters so that it becomes ' '. This causes problems when performing searches unless I use 'istartswith'.

Change History (3)

comment:1 Changed 11 years ago by Chris Beaven

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

comment:2 Changed 11 years ago by benk

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 Changed 11 years ago by Matt Boersma

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