Code

Opened 7 years ago

Closed 7 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:

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'.

Attachments (0)

Change History (3)

comment:1 Changed 7 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

comment:2 Changed 7 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 7 years ago by bouldersprinters

  • Component changed from Uncategorized to Database wrapper
  • Resolution set to fixed
  • Status changed from new to closed
  • Version changed from SVN to other branch

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.