Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yx4Ce-0003IV-P5 for pgsql-bugs@arkaria.postgresql.org; Tue, 26 May 2015 02:02:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yx4Ce-00027j-6V for pgsql-bugs@arkaria.postgresql.org; Tue, 26 May 2015 02:02:48 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yx4Cc-00025j-R9 for pgsql-bugs@postgresql.org; Tue, 26 May 2015 02:02:47 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1Yx4Ca-0002uj-4z for pgsql-bugs@postgresql.org; Tue, 26 May 2015 02:02:45 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id CB2DF5F7A5; Mon, 25 May 2015 22:02:43 -0400 (EDT) Date: Mon, 25 May 2015 22:02:43 -0400 From: Stephen Frost To: Michael Paquier Cc: Alvaro Herrera , PostgreSQL mailing lists Subject: Re: Incorrect processing of CREATE TRANSFORM with DDL deparding Message-ID: <20150526020243.GU26667@tamriel.snowman.net> References: <20150525155248.GG5885@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9523qaMzr8lfC2zQ" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-46-generic (x86_64) X-Uptime: 21:56:12 up 67 days, 7:44, 15 users, load average: 0.13, 0.11, 0.08 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --9523qaMzr8lfC2zQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Michael Paquier (michael.paquier@gmail.com) wrote: > On Tue, May 26, 2015 at 12:52 AM, Alvaro Herrera wrote: > > Michael Paquier wrote: > >> In ProcessUtilitySlow()@utility.c, for a node T_CreateTransformStmt, > >> process does not return ObjectAddress. This makes process inconsistent > >> with the other commands and the ObjectAddress passed to > >> EventTriggerCollectSimpleCommand is not initialized. > >> Coverity has pointed out the error, I just some legwork to sort out a = fix. > > > > Yeah, I had noticed this and was pretty annoyed because we ended up in > > precisely the situation we didn't want to be: new code is added to > > ProcessUtility that is not handled by the deparse framework. (I > > don't know whether TRANSFORM went in first or deparse, but it doesn't > > really matter.) > > > > The fix as you say is pretty trivial, but I would like to use this is a > > test case to ensure that we will catch all these mistakes in the future > > too not only this particular one. >=20 > I guess that you could add an assertion at the bottom of > ProcessUtilitySlow() as well to check code paths where ObjectAddress > is not initialized correctly. I seem to recall that being in one of the variations of this patch and I tend to agree that it makes sense... That said, I'm really not all that happy with the split between ProcessUtility() and ProcessUtilitySlow(). I've not said anything since I haven't got any great solutions to the issue, but it really is pretty grotty. I realize it might take a few extra cycles, but my thinking is along the lines of having an array or similar which we scan that indicates what is supported by deparse/event triggers, what isn't, etc, and then we operate based on that.. Perhaps an array which is indexed based on the NodeTag enum? I realize that'd be a stupidly large array, of, I dunno, 8k or more, but it'd surely make ProcessUtility a heck of a lot shorter/simpler.. Considering the line count between the two is over 1000, perhaps it'd be a net savings in size, if not speed. Just a few off-the-cuff thoughts. Thanks! Stephen --9523qaMzr8lfC2zQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJVY9RDAAoJEO1sijiDR2RV8vYQALfDY8px4gswReEqbVGiA1fE SucoIQfKmnrz1bmsDgN7wmPWLpKXMPuqqvrL9YyPJxVgOxc2zF4eL7LVJWefg/8h oL/ZtpCwlH8j97gd4RWb6dZEJjRiP9KrJMvEM3YbxCCR68gZ0Xd1dRsZWSMnxok2 QEOHJZcHA1pNhime7BTHyLu6GqAdycHhk+3trpwyY1r0342W+gfgjmOuesOb6oOC Y4ZgHEVMpC300KgA7LNeRi/UTQsWRrIvqyH/3GOwYQdpdArZstPdyZlXYGNvZzfw Ywob24NJOTWPYJ3fR5tMbvpuSerbkp8DogX045HEWM/1TaLex7xmh1G5YjuLpUv+ dm6sezWEka/DtbpoNiYIPkt03cZSCb2IT5Qys4P7U+T6FRwucigZkeJfkLjol9RO uBWPQCWgcyKjNFvnurZIo+fKwNu9D7RkvOatY7s0fC7ZhJhx8+bfUo3ye/giCTpT w9lzAAyywsu6dBulTYuCgKxIcmWPKFRGO+9iSsUReqpaSpYoYW1AZSHB6PMwl/AB 5CY5orM0joE/PfL96rZVbgBOd49U+8+Rms/2QzA1rWZEl+h+2uQNbEURXghOhu0k KyzDyVTZ3g9yV+D0c1HKw4VIUTtM7wCKRj136oqfXu5BQDfbjAWxp4+1f0bLX0So CSZzXSZqIN4ycg8UL6CG =9pX6 -----END PGP SIGNATURE----- --9523qaMzr8lfC2zQ--