[rt-devel] Changes for bigint tickets

Bruce Campbell bruce_campbell at ripe.net
Wed Feb 6 03:37:37 EST 2002

On Tue, 5 Feb 2002, Rich Lafferty wrote:

> On Tue, Feb 05, 2002 at 04:31:40PM -0500, Rich Lafferty (rich+rt at lafferty.ca) wrote:
> >
> > An additional observation: Deleting the malformed tickets and setting
> > the sequence to start back at an int-sized number got everything

Personally I'd be declaring your bigints to be unsigned as well, but thats
merely to allow lots of room in the number sequence, rather than half of
them possibly negative and not needed.  This has little, if any, bearing
on your problem though.

> > working fine, but pushing the sequence back up beyond an int breaks.
> > The sequence appears to keep working, though, because Ticket.id is set
> > correctly.
> Still more detail -- It succeeds at 4294967296 (UINT_MAX + 1), but
> fails at 4294967297 (UINT_MAX + 2). But when it fails at UINT_MAX + 2,

This is beginning to sound like a perl problem, specifically how perl
groks numbers.  A peruse of the perlnumber manpage puts the limititations
on 'a format supported by the C compiler which was used to build perl'.
You will probably find the above number declared in stdint.h in your
system (on a handy linux 2.2.x box, its UINT32_MAX )

Perhaps a better solution would be to not mess with the representation of
the ticket ids in the SQL database (ie, keep as integer).  As I see it,
you merely have a cosmetic problem, with what your customers/staff
recognise as a ticket 'id'.  Assume that you also store a column (tied to
the Ticket->id) known as 'PublicId':

	rt-mailgate to recognise [$rtname #PublicId] in your subject line.

	RT::Ticket to have a function to retrieve the PublicId.  Load()
	also needs to be able to retrieve from this column.

	RT::Action::SendEmail to use Ticket->PublicId instead of

	Various Templates which do the same.

	WebUI to display and load PublicId instead of id.

The easiest place to put the 'PublicId' is the 'Tickets' table, as an
extra column.  A graceful place to put it (and requires no changes to an
RT SQL installation) is in the 'Links' table.  Jesse will probably hit me
for that as I suggested putting Scrip dependencies in there as well ;)

                             Bruce Campbell                            RIPE
                   Systems/Network Engineer                             NCC
                 www.ripe.net - PGP562C8B1B                      Operations

More information about the Rt-devel mailing list