Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id BD3621337BED for ; Tue, 10 May 2011 13:20:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 46211-02-2 for ; Tue, 10 May 2011 16:20:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.piware.de (unknown [213.9.93.70]) by mail.postgresql.org (Postfix) with ESMTP id B346D1337B83 for ; Tue, 10 May 2011 13:20:27 -0300 (ADT) Received: from localhost.localdomain (business-89-133-214-82.business.broadband.hu [89.133.214.82]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Martin Pitt (ThinkPad)", Issuer "piware CA" (verified OK)) by mail.piware.de (Postfix) with ESMTPS id C8EAC1517A60 for ; Tue, 10 May 2011 18:19:39 +0200 (CEST) Received: by localhost.localdomain (Postfix, from userid 1000) id 7BBFB40B68; Tue, 10 May 2011 18:20:23 +0200 (CEST) Date: Tue, 10 May 2011 18:20:23 +0200 From: Martin Pitt To: PostgreSQL Bugs Subject: Changed behaviour of \' Message-ID: <20110510162023.GA2490@piware.de> Mail-Followup-To: PostgreSQL Bugs MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="+QahgC5+KEYLbs62" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.107 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RDNS_NONE=0.793 X-Spam-Level: X-Archive-Number: 201105/70 X-Sequence-Number: 30209 --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello again, sorry for spamming you today, but I promise that this is the last mail; it's the one remaining test case failure for me. I have some test cases to verify the handling of the obsolete \' escaping in different locales (cf. CVE-2006-2313). Up to 9.0, \' was still allowed in safe locales, but not in unsafe ones (so= rry for German error messages, but they just complain about unsafe usage of \'): ----------------------- 8< ---------------- $ printf "set client_encoding=3D'SJIS'; select '\\\\'a'" | psql -Atq templa= te1 FEHLER: unsichere Verwendung von \' in Zeichenkettenkonstante LINE 1: select '\'a' ^ HINT: Verwenden Sie '', um Quotes in Zeichenketten zu schreiben. \' ist in= bestimmten Client-seitigen Kodierungen unsicher. $ printf "set client_encoding=3D'UTF8'; select '\\\\'a'" | psql -Atq templa= te1 WARNUNG: nicht standardkonforme Verwendung von \' in Zeichenkettenkonstante LINE 1: select '\'a' ^ HINT: Verwenden Sie '', um Quotes in Zeichenketten zu schreiben, oder verw= enden Sie die Syntax f=FCr Escape-Zeichenketten (E'...'). 'a ----------------------- 8< ---------------- (Note the last line here, where it outputs 'a). 9.1 still rejects \' in SJIS, but it now also rejects \' in UTF-8: ----------------------- 8< ---------------- $ printf "set client_encoding=3D'SJIS'; select '\\\\'a'" | psql -Atq templa= te1 ERROR: unterminated quoted string at or near "'" LINE 1: select '\'a' $ printf "set client_encoding=3D'UTF8'; select '\\\\'a'" | psql -Atq templa= te1 ERROR: unterminated quoted string at or near "'" LINE 1: select '\'a' ----------------------- 8< ---------------- Since HISTORY does not mention this, is that an explicit decision to finally deprecate the old \' syntax (which would be great, as it makes this thing a lot more robust and deterministic, but it might be worth mentioning it in HISTORY), or an unintended side effect? Thanks, Martin --=20 Martin Pitt | http://www.piware.de Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org) --+QahgC5+KEYLbs62 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBCAAGBQJNyWXEAAoJEPmIJawmtHufRacP/AqrVnJO3lvmKTSivp69didb a9FETRLGfXAzz688PGevx32+snqaPAl8oNLetnXMu8WYcgBhX6yUBcRvlrbWSs/e 9RQU4JDs1QTs4jPyPQrzKSGfDkeCAwrOf5OvIkku4HyRfA+nuFm632s9ExsNoW/5 Ky4LeBQ1RcpK7I6SZ3rJRKZuENcr/iJJpDzh0xSGN6QD0+vXhuUFxx0tzcQPgA/c sITDeDAfYfT9Z0p8oCOXibd/36dNbMq9nIobAlkcez4vhCD2Y6+GBCDO2usj/w8r uzvHkzTkl0CbHMG9nLtdEswBvL/bNM98sI23+QEQLO1IeRWGER+fmt3I6WMg9O/n x9i/JEMTSmc9ZpRztlmdzMlDjxRhyuqsB+KKkJGGV4RQqx1SCTUkUSENa4Xe1UCT 2RaCvGxFTyficMnzvLAW9nWFi52A9l+SrsI1TZHB8THQRVZM/48Lc6tI8pBZFPNS S7vBjtjCTuIRWKlbywGDI8kvUaMx6UO4oVu9tqp4XStWeZrdfQY/Zhc+vpRzNPpZ BGCCngz4n/0FecK/BSWmY2V0rYyYMF6XBXr3pJWtdOMralcRVetLvjnU5SyWYIMj RZaJrpSY3KyzWyUMwu4+VpB6/Gab9wPTpJOrVynzBY4KK0Ok8sBmoPyJUEkXWT+p 3sH+Qu83KzRBo5mqT6x8 =HMe0 -----END PGP SIGNATURE----- --+QahgC5+KEYLbs62--