Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5I0Y-0005bd-KJ for pgsql-committers@arkaria.postgresql.org; Sun, 08 Apr 2018 21:37:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f5I0X-0006Qp-CC for pgsql-committers@arkaria.postgresql.org; Sun, 08 Apr 2018 21:37:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5I0X-0006Qg-1h for pgsql-committers@lists.postgresql.org; Sun, 08 Apr 2018 21:37:53 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f5I0T-0007El-G2 for pgsql-committers@lists.postgresql.org; Sun, 08 Apr 2018 21:37:52 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id DDEA521C1C8B for ; Mon, 9 Apr 2018 00:37:47 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from mail-oi0-f52.google.com (mail-oi0-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (not verified)) by mail.postgrespro.ru (Postfix) with ESMTPSA id 6F9FD21C1C90 for ; Mon, 9 Apr 2018 00:37:47 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1523223467; bh=wwtT8ITy5Whkf+Pa7vkWM1CbtssfOFsBY+mk8qAD3IE=; h=In-Reply-To:References:From:Date:Subject:To:Cc; b=lcufZWFpJJnSz2TC2aJIxi1j7D709Q2u84uEMPY9iRlGMhP72xi8Wy1zxxykosM3w /z3fVScMBX9+TEbhMvvhAVuRVrmEVfEYt+ezM3lDkfhSrQBJQuZGNMpIUqxSd6hZ12 XbHE3J18XUfHEzNPmE/KKefKkEIHGqUs+c8NXKiA= Received: by mail-oi0-f52.google.com with SMTP id t16-v6so5818115oih.3 for ; Sun, 08 Apr 2018 14:37:47 -0700 (PDT) X-Gm-Message-State: ALQs6tAJbWRk+xp3b+4UWxebKILVC/CN1fLe4D0OuFaIzVhFWziU6+Zl u33MltoTZhXMy1CNbssBCUi8DHIQOVPYBWiZVVE= X-Google-Smtp-Source: AIpwx48Fmz/DA8iAnXeP8T+KKO9ftC7j5HTOigxt2A1NN/sGh+VWNpkLlvyo7rwv6KyceErE7244kK3H59tj3dTBU+M= X-Received: by 2002:aca:afd0:: with SMTP id y199-v6mr14163864oie.296.1523223465630; Sun, 08 Apr 2018 14:37:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.35.146 with HTTP; Sun, 8 Apr 2018 14:37:25 -0700 (PDT) In-Reply-To: <324.1523222839@sss.pgh.pa.us> References: <26445.1523198494@sss.pgh.pa.us> <95278363-d49f-a5e3-106f-d92fac547e19@sigaev.ru> <324.1523222839@sss.pgh.pa.us> From: Alexander Korotkov Date: Mon, 9 Apr 2018 00:37:25 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: pgsql: Indexes with INCLUDE columns and their support in B-tree To: Tom Lane Cc: Teodor Sigaev , pgsql-committers Content-Type: multipart/alternative; boundary="00000000000095246805695d19dd" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000095246805695d19dd Content-Type: text/plain; charset="UTF-8" On Mon, Apr 9, 2018 at 12:27 AM, Tom Lane wrote: > Alexander Korotkov writes: > > There is also patch for valgrind error in CheckIndexCompatible(). > > It appears that this function didn't initialize ii_NumIndexAttrs and > > ii_NumIndexKeyAttrs before calling ComputeIndexAttrs(). This > > variables weren't used before, but now they're used to determine > > whether index column is key. Also, this patch makes ComputeIndexAttrs() > > initialize classOidP elements with InvalidOid for non-key attributes. > > You didn't test this quite enough, because when I tried it I got a batch > of warnings about memory chunk inconsistencies. The reason was that > DefineIndex only allocated a classObjectId array large enough for the > key columns, so that the change in ComputeIndexAttrs made it write past > the end of that array. Sorry, my bad. But I think it's a good idea to make those output > arrays all the same length, so I kept that change and changed DefineIndex. > > Pushed; I've not checked to see if this makes valgrind happy, but > the buildfarm will tell us. > Thank you! ------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company --00000000000095246805695d19dd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Apr 9, 2018 at 12:27 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Alexander Korotkov <a.korotkov@postgrespro.ru> writes:=
> There is also patch for valgrind error in CheckIndexCompatible().
> It appears that this function didn't initialize ii_NumIndexAttrs a= nd
> ii_NumIndexKeyAttrs before calling ComputeIndexAttrs().=C2=A0 This
> variables weren't used before, but now they're used to determi= ne
> whether index column is key.=C2=A0 Also, this patch makes ComputeIndex= Attrs()
> initialize classOidP elements with InvalidOid for non-key attributes.<= br>
You didn't test this quite enough, because when I tried it I got= a batch
of warnings about memory chunk inconsistencies.=C2=A0 The reason was that DefineIndex only allocated a classObjectId array large enough for the
key columns, so that the change in ComputeIndexAttrs made it write past
the end of that array.

Sorry, my bad.
=

But I think it's a good i= dea to make those output
arrays all the same length, so I kept that change and changed DefineIndex.<= br>
Pushed; I've not checked to see if this makes valgrind happy, but
the buildfarm will tell us.

Thank you!<= /div>

------
Alexander Korotkov
Postgres Professional:=C2=A0http://www.postgrespro.com
The R= ussian Postgres Company=C2=A0

--00000000000095246805695d19dd--