Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rk6Jk-00AIxv-BL for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Mar 2024 17:53:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rk6Ji-00HFo8-2c for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Mar 2024 17:53:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rk6Jh-00HFnY-3y for pgsql-hackers@lists.postgresql.org; Tue, 12 Mar 2024 17:53:34 +0000 Received: from wfhigh5-smtp.messagingengine.com ([64.147.123.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rk6Jd-0049um-93 for pgsql-hackers@postgresql.org; Tue, 12 Mar 2024 17:53:32 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id 3D4D3180007E; Tue, 12 Mar 2024 13:53:28 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 12 Mar 2024 13:53:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1710266007; x= 1710352407; bh=lhQyUA6/g237qg7S/6V4b+RyUt1V2MMSwjvpLvzPrpE=; b=r BWVphuLnpL9wtID4qyLpkQI8MQS4JM5hqPqhDz2Nrn2edRQ7MkeN3bBCC8iCp4Jh AVSNtT+i2DncIYQoTWhxqs1/KYMbf5Alu86ota53uirwcFTxYiy1D8S+KGzs0+BP lujv5RFW3uHxx3g0I7EeKC2nKXntKqxkgogNwB+VIWTfZJsRwHwN7J5+uTNUmI8u 9Kh2MC/HN9fkGn18ct3rVFXWQmXvv6PwB2RBsQzK/+Kuhv2AC7pLZkAGdw2DtN2u gr6QFY6zVnMd4xCwCDwVcIwdHTCbQG34XyuoTu9al5hEySfjFKS/JssfTpphMIEU tbhymlQFmK3JWvYMi7HhA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrjeefgddutdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfggtggugfgjsehtke ertddttdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhr vgesrghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedvkedtffduff dtffffheffhfejjefhgfeiueeukeejkeffgfdufffhudffffeuveenucffohhmrghinhep vghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhr gh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Mar 2024 13:53:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1710266003; bh=T/2+W9YL/zAGDor8UujjOiNhaXdGBJlWRMG0uez4Ycc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=NvC+fdwdbxIcC+2N7VvPiMlb0Ec6Hax9PbvSdYprQoMA2Etlmb+6N5l231F+fncbJ R4W7GbO66Ghy1O54hsC61QKZet+AukmpFKxUtinVNPbmXbmD7XvbwrvdA/F+w4VsVZ ruTvkyzK1RIo6NThHZJuNF6LfMYQIRVMENmsNBaaAsYKkq09WjWB32gjcP7sv1vpZz suyVWV0ihz7QtJNxcdHlveF4PA6WlsbAVfN9/0QYodPFQpivvfnv/KeBvTBVovli7N tJt6v55m1UCB1F4Vk4y34cTs+6uUmy7CIVfloVRV5Wn+Wt3xFgdYpQcgIH/hB9Cx6y ROwSycQdJCTOw== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id B111BCD5; Tue, 12 Mar 2024 18:53:23 +0100 (CET) Date: Tue, 12 Mar 2024 18:53:23 +0100 From: Alvaro Herrera To: Jeff Davis Cc: pgsql-hackers@postgresql.org Subject: Re: perl: unsafe empty pattern behavior Message-ID: <202403121753.lw7u5b5fjsjw@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4a1db3c8ea39156dbe4a4f9e166ca9453e05daaa.camel@j-davis.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Mar-12, Jeff Davis wrote: > Do not use perl empty patterns like // or qr// or s//.../, the behavior > is too surprising for perl non-experts. Yeah, nasty. > There are a few such uses in > our tests; patch attached. Unfortunately, there is no obvious way to > automatically detect them so I am just relying on grep. I'm sure there > are others here who know more about perl than I do, so > suggestions/corrections are welcome. I suggest that pg_dump/t/002_pg_dump.pl could use a verification that the ->{regexp} thing is not empty. I also tried grepping (for things like qr{}, qr[], qr||, qr!!) and didn't find anything beyond what you have ... but I only looked for the "qr" literal, not other ways to get regexes. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ Bob [Floyd] used to say that he was planning to get a Ph.D. by the "green stamp method," namely by saving envelopes addressed to him as 'Dr. Floyd'. After collecting 500 such letters, he mused, a university somewhere in Arizona would probably grant him a degree. (Don Knuth)