Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id B72E7B5DBDD for ; Sun, 19 Jun 2011 14:23:04 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 39424-07 for ; Sun, 19 Jun 2011 17:22:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f46.google.com (mail-pz0-f46.google.com [209.85.210.46]) by mail.postgresql.org (Postfix) with ESMTP id 4FD85B5DBC2 for ; Sun, 19 Jun 2011 14:22:57 -0300 (ADT) Received: by pzk9 with SMTP id 9so2940158pzk.19 for ; Sun, 19 Jun 2011 10:22:57 -0700 (PDT) Received: by 10.68.29.100 with SMTP id j4mr1776982pbh.197.1308504177255; Sun, 19 Jun 2011 10:22:57 -0700 (PDT) Received: from [192.168.1.101] (c-69-181-249-16.hsd1.ca.comcast.net [69.181.249.16]) by mx.google.com with ESMTPS id x1sm2715813pbb.2.2011.06.19.10.22.55 (version=SSLv3 cipher=OTHER); Sun, 19 Jun 2011 10:22:56 -0700 (PDT) Subject: Re: PG regression with row comparison when btree_gist is enabled (BUG) From: Jeff Davis To: oleg@sai.msu.su Cc: Denis de Bernardy , Teodor Sigaev , pgsql-bugs@postgresql.org In-Reply-To: <1308428403.2597.66.camel@jdavis> 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> Content-Type: multipart/mixed; boundary="=-T8QQfWaiyWtfGFc5TEN+" Date: Sun, 19 Jun 2011 10:23:10 -0700 Message-ID: <1308504190.2597.71.camel@jdavis> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201106/168 X-Sequence-Number: 30547 --=-T8QQfWaiyWtfGFc5TEN+ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit On Sat, 2011-06-18 at 13:20 -0700, Jeff Davis wrote: > Interesting problem... the bug is in get_op_btree_interpretation() which > has code like this: > > /* > * If 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. > */ > op_negated = false; > if (catlist->n_members == 0) > > > However, that's a bogus test, because btree_gist puts <> into an > opfamily. Thus, catlist->n_members == 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. Patch attached. Regards, Jeff Davis --=-T8QQfWaiyWtfGFc5TEN+ Content-Type: application/x-gzip; name="rowcmp.patch.gz" Content-Disposition: attachment; filename="rowcmp.patch.gz" Content-Transfer-Encoding: base64 H4sIAIcv/k0AA9VWWU/bQBB+Nr9ieAE7B4ECARQSiYaURgKCQto+VJW1sTfJtr7q3QhFiP/e2cPO piAKlCLVD856dq5vzlQqFSANngeNMQl+0CRszAWLeCMgwYw2Ir7g6rQVrNXrdRg/ibOy+shvaO7u 15p72yAJMKXCTzN/LHJKfZYImmc5FUSwNHEHLIQ0S9IanDMukD/NJiRmEaPcInGRE8E95ZRWvQN4 rq8BOF0iuooRoBIQEeGxJenjNI0cB+0mdEoEDRURrTuOw1prVXDQtLNkSHPJIHksF6ANl/3zlqFq Lwrag7D39mrN5uFrw0bzUGnIHwMQfbimJA9m1wvelWmQIjvuycXganDVP63BYPydBqIfnlFxSsQ8 dqUxzysgNipaJ/QncEMhIMmmgAlLQiDJAowvCwjSRBCWsGQKYkaRXoOM5jOScWACGAcCxx2jKcUb GcUtQNcosIlkmRHJY+KLOoiSYgmaKa1sFfDWwcoWIpyQiNOWJKMy1yCvdxI/pvGY5piINmx78v5W vu7lE1XIFJgvHQEVAMksVaJAn38mEQvdpZSnNBqVqw6JfK79cZwhjSjh1A5/4aFnWJ6YKs1sHngo cUvPtO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