Skip site navigation (1) Skip section navigation (2)

Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: John Brothers <johnbr(at)mindspring(dot)com>, pgsql-general(at)hub(dot)org, pgsql-sql(at)hub(dot)org
Subject: Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4
Date: 2000-01-28 05:31:26
Message-ID: 200001280531.AAA11561@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackerspgsql-sql
> Actually, if Nicolas' table contains both very large positive and very
> large negative integers, then his index could be messed up pretty badly.
> What Hiroshi saw (and I missed :-() was that btint4cmp can fail and
> return a result of the wrong sign if the difference between two integers
> overflows.  Since index sorting depends critically on the assumption
> that the comparator always returns consistent results (a < b and b < c
> must imply a < c, but this can fail if a - c overflows), you could have
> an out-of-order index.  And then probes into the index could fail to
> find items they should find ... which is exactly the complained-of
> symptom.
> 
> Hiroshi neglected to mention that you'd probably need to drop and
> recreate the index after applying the patch; if it's indeed out of
> order, just patching the comparator bug isn't enough to fix it.
> 

Does Hiroshi's patch get applied?

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

Responses

pgsql-hackers by date

Next:From: Oliver ElphickDate: 2000-01-28 05:38:10
Subject: Can't access CVS
Previous:From: Tom LaneDate: 2000-01-28 05:26:11
Subject: Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)

pgsql-sql by date

Next:From: Tom LaneDate: 2000-01-28 05:59:55
Subject: Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4
Previous:From: Tom LaneDate: 2000-01-28 04:49:14
Subject: Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4

pgsql-general by date

Next:From: Tom LaneDate: 2000-01-28 05:59:55
Subject: Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4
Previous:From: Tom LaneDate: 2000-01-28 04:49:14
Subject: Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group