Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WE0LN-0004eu-NE for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Feb 2014 17:45:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WE0LN-0007Le-2W for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Feb 2014 17:45:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WE0LM-0007LV-4o for pgsql-bugs@postgresql.org; Thu, 13 Feb 2014 17:45:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WE0LG-0005zA-Bm for pgsql-bugs@postgresql.org; Thu, 13 Feb 2014 17:44:59 +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 s1DHiq3I006918; Thu, 13 Feb 2014 12:44:52 -0500 From: Tom Lane To: pythonesque@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #9204: truncate_identifier may be called unnecessarily on escaped quoted identifiers In-reply-to: <20140213024415.2708.54432@wrigleys.postgresql.org> References: <20140213024415.2708.54432@wrigleys.postgresql.org> Comments: In-reply-to pythonesque@gmail.com message dated "Thu, 13 Feb 2014 02:44:15 +0000" Date: Thu, 13 Feb 2014 12:44:52 -0500 Message-ID: <6917.1392313492@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) 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 pythonesque@gmail.com writes: > As in description. This follows from how these are scanned in scan.l: > ident = litbuf_udeescape('\\', yyscanner); > if (yyextra->literallen >= NAMEDATALEN) > truncate_identifier(ident, yyextra->literallen, true); Yeah, that's a bug --- yyextra->literallen is not the thing to use here. It's just luck that truncate_identifier doesn't fail entirely, since we're violating its API contract. Will fix, thanks for reporting it. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs