Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKDKX-0003FF-TB for pgsql-committers@arkaria.postgresql.org; Mon, 12 Jun 2017 00:35:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dKDKX-0005HA-5D for pgsql-committers@arkaria.postgresql.org; Mon, 12 Jun 2017 00:35:41 +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.84_2) (envelope-from ) id 1dKDKV-0005Gx-LY for pgsql-committers@postgresql.org; Mon, 12 Jun 2017 00:35:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dKDKM-0001Im-U2 for pgsql-committers@postgresql.org; Mon, 12 Jun 2017 00:35:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v5C0ZRY5010975; Sun, 11 Jun 2017 20:35:27 -0400 From: Tom Lane To: Joe Conway cc: pgsql-committers@postgresql.org Subject: Re: pgsql: Apply RLS policies to partitioned tables. In-reply-to: References: Comments: In-reply-to Joe Conway message dated "Sun, 11 Jun 2017 15:52:06 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10973.1497227727.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 11 Jun 2017 20:35:27 -0400 Message-ID: <10974.1497227727@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org Joe Conway writes: > Apply RLS policies to partitioned tables. Buildfarm member skink has grown a "make check" failure with this commit. =3D=3D28150=3D=3D VALGRINDERROR-BEGIN =3D=3D28150=3D=3D Invalid read of size 8 =3D=3D28150=3D=3D at 0x39A355: ExecInitModifyTable (nodeModifyTable.c:18= 62) =3D=3D28150=3D=3D by 0x37F0F8: ExecInitNode (execProcnode.c:168) =3D=3D28150=3D=3D by 0x37C219: InitPlan (execMain.c:1044) =3D=3D28150=3D=3D by 0x37C3AF: standard_ExecutorStart (execMain.c:256) =3D=3D28150=3D=3D by 0x37C4B8: ExecutorStart (execMain.c:151) =3D=3D28150=3D=3D by 0x4CCCCE: ProcessQuery (pquery.c:157) =3D=3D28150=3D=3D by 0x4CCEDF: PortalRunMulti (pquery.c:1287) =3D=3D28150=3D=3D by 0x4CDE19: PortalRun (pquery.c:800) =3D=3D28150=3D=3D by 0x4C9E85: exec_simple_query (postgres.c:1099) =3D=3D28150=3D=3D by 0x4CBF20: PostgresMain (postgres.c:4087) =3D=3D28150=3D=3D by 0x44DC04: BackendRun (postmaster.c:4331) =3D=3D28150=3D=3D by 0x44FD9B: BackendStartup (postmaster.c:4003) =3D=3D28150=3D=3D Address 0xbbdbec8 is 8,008 bytes inside a recently re-al= located block of size 8,192 alloc'd =3D=3D28150=3D=3D at 0x4C2AB76: malloc (vg_replace_malloc.c:299) =3D=3D28150=3D=3D by 0x6002D2: AllocSetAlloc (aset.c:760) =3D=3D28150=3D=3D by 0x606EB5: MemoryContextAllocZeroAligned (mcxt.c:791) =3D=3D28150=3D=3D by 0x3832B1: CreateExecutorState (execUtils.c:99) =3D=3D28150=3D=3D by 0x37C2E6: standard_ExecutorStart (execMain.c:186) =3D=3D28150=3D=3D by 0x37C4B8: ExecutorStart (execMain.c:151) =3D=3D28150=3D=3D by 0x4CCCCE: ProcessQuery (pquery.c:157) =3D=3D28150=3D=3D by 0x4CCEDF: PortalRunMulti (pquery.c:1287) =3D=3D28150=3D=3D by 0x4CDE19: PortalRun (pquery.c:800) =3D=3D28150=3D=3D by 0x4C9E85: exec_simple_query (postgres.c:1099) =3D=3D28150=3D=3D by 0x4CBF20: PostgresMain (postgres.c:4087) =3D=3D28150=3D=3D by 0x44DC04: BackendRun (postmaster.c:4331) =3D=3D28150=3D=3D=20 =3D=3D28150=3D=3D VALGRINDERROR-END The cited line is the ExecInitQual call here: /* varno =3D node->nominalRelation */ mapped_wcoList =3D map_partition_varattnos(wcoList, node->nominalRelation, partrel, rel); foreach(ll, mapped_wcoList) { WithCheckOption *wco =3D (WithCheckOption *) lfirst(ll); ExprState *wcoExpr =3D ExecInitQual((List *) wco->qual, mtstate->mt_plans[i]); wcoExprs =3D lappend(wcoExprs, wcoExpr); } First guess is that map_partition_varattnos has forgotten to handle WithCheckOption.qual. If so, though, and if that's not resulting in visible misbehavior in the regression tests, then we are missing a case that the regression tests should be covering. BTW, it might be advisable to use castNode(WithCheckOption, ...) in the line before that. regards, tom lane --=20 Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers