Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 8AD67632F6F for ; Fri, 5 Jun 2009 23:39:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 34043-09 for ; Fri, 5 Jun 2009 23:39:33 -0300 (ADT) Received: from cvs.postgresql.org (cvs.postgresql.org [217.196.146.206]) by mail.postgresql.org (Postfix) with ESMTP id B809B63270B for ; Fri, 5 Jun 2009 23:39:42 -0300 (ADT) Received: by cvs.postgresql.org (Postfix, from userid 1007) id BD4B875331E; Sat, 6 Jun 2009 02:39:40 +0000 (UTC) MIME-Version: 1.0 To: pgsql-committers@postgresql.org Subject: pgsql: Fix a serious bug introduced into GIN in 8.4: now that X-Mailer: activitymail 1.24, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain Message-Id: <20090606023940.BD4B875331E@cvs.postgresql.org> Date: Sat, 6 Jun 2009 02:39:40 +0000 (UTC) From: tgl@postgresql.org (Tom Lane) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200906/82 X-Sequence-Number: 37286 Log Message: ----------- Fix a serious bug introduced into GIN in 8.4: now that MergeItemPointers() is supposed to remove duplicate heap TIDs, we have to be sure to reduce the tuple size and posting-item count accordingly in addItemPointersToTuple(). Failing to do so resulted in the effective injection of garbage TIDs into the index contents, ie, whatever happened to be in the memory palloc'd for the new tuple. I'm not sure that this fully explains the index corruption reported by Tatsuo Ishii, but the test case I'm using no longer fails. Modified Files: -------------- pgsql/src/backend/access/gin: gindatapage.c (r1.14 -> r1.15) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/gin/gindatapage.c?r1=1.14&r2=1.15) ginentrypage.c (r1.19 -> r1.20) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/gin/ginentrypage.c?r1=1.19&r2=1.20) gininsert.c (r1.20 -> r1.21) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/gin/gininsert.c?r1=1.20&r2=1.21) pgsql/src/include/access: gin.h (r1.32 -> r1.33) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/gin.h?r1=1.32&r2=1.33)