Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id C9B64B5DC0A for ; Mon, 20 Jun 2011 04:23:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 14936-08 for ; Mon, 20 Jun 2011 07:23:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm27.bullet.mail.sp2.yahoo.com (nm27.bullet.mail.sp2.yahoo.com [98.139.91.97]) by mail.postgresql.org (Postfix) with SMTP id 38953B5DBC2 for ; Mon, 20 Jun 2011 04:23:46 -0300 (ADT) Received: from [98.139.91.61] by nm27.bullet.mail.sp2.yahoo.com with NNFMP; 20 Jun 2011 07:23:46 -0000 Received: from [98.139.91.60] by tm1.bullet.mail.sp2.yahoo.com with NNFMP; 20 Jun 2011 07:23:46 -0000 Received: from [127.0.0.1] by omp1060.mail.sp2.yahoo.com with NNFMP; 20 Jun 2011 07:23:46 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 202798.14084.bm@omp1060.mail.sp2.yahoo.com Received: (qmail 3486 invoked by uid 60001); 20 Jun 2011 07:23:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1308554625; bh=xtLngWEcGt2+TqVK59Ypvn/trlwgpJLvy/9RLdEEuW8=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=PGQnmPiH/OmsbU4aH8ys8HE9xObPIBU0PVccW2jMtqK8FgilL0smfIpxdbCzXGqBnQx53boL+rDCZ7KztBJzyv37NESpB3FpKKiljtfV+HbUNWqNm2NO1/0iDzWs/KY/PuE9GgHLyBnwSFxbBTP7LkGkohR2ZoYB7SU4w5fLa5Q= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=ts03OgepOcKprWYeOOtT7iBOj2tghRJmRoDMZrRGCN9JA9Dhy4w3GnPsYDhecU9aJ9bzY2VyOrPIP/QbBtFpf8cfGBLUbS3kUulhplBj6GTTwg3uUy9RsvyrfzoaT3gPwd3hKbumk02elVoa/sQCMMMkCgnOaip78s03fxaPY1I=; Message-ID: <636928.87301.qm@web112417.mail.gq1.yahoo.com> X-YMail-OSG: pYHI.KwVM1kdPlRwi5MtElRE7I1zXp_SK.28vbNqR8AiBPu 5Teg_uwT3tEoYCMpJ9Apm5apD.vcg6HhllJluSEnno8Z_euW23fR5DgtfUC. 7ce331bY2Z8dnAGlFyuXRn1vewXXkrh09GAOaBR.OXo0GWP7DThicT2NBKXo 6zTgYZVyCgYeO_v4CtUSW0EHpm8mRZrJFCIUiIiW4p9lu1wqDAZBZB_KtzKf t1nelr2LtGJuqNszd1vH87hMfwKstGEGlKvO5SHQjvwnqtntV.QwUt8wfEnn ikdRINmaMJulwRIqc7LbeFOcNzB2_FYdSMU6MQ_ddxIgSViH4nnys7Yam3XO eNym.sIDxDBP4qFiNnPGJznvenHAcqGxJcwyPJaaCdvxecLz9oAFjBhUyuxk IiwOaMNhz3aC72w-- Received: from [88.203.16.8] by web112417.mail.gq1.yahoo.com via HTTP; Mon, 20 Jun 2011 00:23:45 PDT X-Mailer: YahooMailWebService/0.8.111.304355 References: <4DF81BA0.3000601@archidevsys.co.nz> <743036.48052.qm@web112401.mail.gq1.yahoo.com> <366790.65150.qm@web112414.mail.gq1.yahoo.com> <1308428403.2597.66.camel@jdavis> <1308504190.2597.71.camel@jdavis> Date: Mon, 20 Jun 2011 00:23:45 -0700 (PDT) From: Denis de Bernardy Reply-To: Denis de Bernardy Subject: Re: PG regression with row comparison when btree_gist is enabled (BUG) To: Jeff Davis , "oleg@sai.msu.su" Cc: Teodor Sigaev , "pgsql-bugs@postgresql.org" In-Reply-To: <1308504190.2597.71.camel@jdavis> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1099490350-1308554625=:87301" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.364 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, FSL_RU_URL=2.271, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/179 X-Sequence-Number: 30558 --0-1099490350-1308554625=:87301 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable I only did some cursory tests, but the patch (applied to Macport's beta2 di= stribution) seems to be working on my dev box (OSX / Snow Leopard).=0A=0AI'= ll report back if I run into oddities further down the road.=0A=0AThanks a = lot!=0ADenis=0A=0A=0A=0A=0A=0A>________________________________=0A>From: Je= ff Davis =0A>To: oleg@sai.msu.su=0A>Cc: Denis de Bernard= y ; Teodor Sigaev ; pgsql-bugs@pos= tgresql.org=0A>Sent: Sunday, June 19, 2011 7:23 PM=0A>Subject: Re: PG regre= ssion with row comparison when btree_gist is enabled (BUG)=0A>=0A>On Sat, 2= 011-06-18 at 13:20 -0700, Jeff Davis wrote:=0A>> Interesting problem... the= bug is in get_op_btree_interpretation() which=0A>> has code like this:=0A>= > =0A>>=A0 /*=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =0A>>=A0 =A0 * If = we can't find any opfamily containing the op, perhaps it is a=0A>> <>=A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =0A>>=A0 =A0 * operator= .=A0 See if it has a negator that is in an=0A>> opfamily.=A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =0A>>=A0 =A0 */= =0A>>=A0 op_negated =3D false;=0A>>=A0 if (catlist->n_members =3D=3D 0)= =0A>> =0A>> =0A>> However, that's a bogus test, because btree_gist puts <> = into an=0A>> opfamily. Thus, catlist->n_members =3D=3D 1 even though we rea= lly do need to=0A>> look for the negator. Really, we need to unconditionall= y search for the=0A>> operator as well as unconditionally searching for the= negator.=0A>=0A>Patch attached.=0A>=0A>Regards,=0A>=A0=A0=A0 Jeff Davis=0A= >=0A>=0A> --0-1099490350-1308554625=:87301 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
I only did= some cursory tests, but the patch (applied to Macport's beta2 distribution= ) seems to be working on my dev box (OSX / Snow Leopard).
=
I'll report back if I run into oddities further down the roa= d.

Thanks a lot!
Denis
<= br>



From: Jeff Davis <= ;pgsql@j-davis.com>
To:<= /b> oleg@sai.msu.su
Cc: De= nis de Bernardy <ddebernardy@yahoo.com>; Teodor Sigaev <teodor@sig= aev.ru>; pgsql-bugs@postgresql.org
Sent: Sunday, June 19, 2011 7:23 PM
Subject: Re: PG regression with row comparison = when btree_gist is enabled (BUG)

=0AOn Sat, 2011-06-18 at 13:= 20 -0700, Jeff Davis wrote:
> Interesting problem... the bug is in ge= t_op_btree_interpretation() which
> has code like this:
>
&= gt;  /*                 =                     &nbs= p;                     &n= bsp;                     =              
>    * I= f we can't find any opfamily containing the op, perhaps it is a
> <= ;>                    =        
>    * operator.  See if= it has a negator that is in an
> opfamily.       = ;                     &nb= sp;        
>    */
>  op_negated =3D false;
> = ; if (catlist->n_members =3D=3D 0)
>
>
> However, t= hat's a bogus test, because btree_gist puts <> into an
> opfami= ly. Thus, catlist->n_members =3D=3D 1 even though we really do need to> look for the negator. Really, we need to unconditionally search for = the
> operator as well as unconditionally searching for the negator.<= br>
Patch attached.

Regards,
    Jeff Davis
=

--0-1099490350-1308554625=:87301--