Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121404 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 89497 invoked from network); 18 Oct 2023 16:02:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Oct 2023 16:02:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AFAA3180044 for ; Wed, 18 Oct 2023 09:02:12 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS19151 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 18 Oct 2023 09:02:12 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id DFDAC5C01BA; Wed, 18 Oct 2023 12:02:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 18 Oct 2023 12:02:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beccati.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1697644930; x=1697731330; bh=me+YBY4AD+ZXDXVHVBMExee1u7kqrFZ6rra Ix+yPtxg=; b=qGPW6NLHOJMrI6nvNwAtIRHKGdPba+i/oSXTQ42OOzOCkG5+VmP r1ZsqNvenS7mrvP160Mmrgs7v/JRD5VCvt7zoJ7T33iAzL21MZXM/8B9f3AfM3fR MtVbSoTD1PJiKKx+xgMyQZfxNBVsz0pgm8cHLSU37mcX/BmD2WUfnlIVna9fUFzN GOHkYXDNDYczZDkWdkhBY1eWT55amk4MAFkYlpsC4PHFGKptR3iHkve2Fj1qjvMe 6k8ud/eUUT0DYuMAvTuS86noTF5jGZht0vrv8cSAK33XdWRY1NFNs9Jq1pNlRZmp hdDZbOMaTmOIehVOM0tdIfbypaHaUHxxr4Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1697644930; x= 1697731330; bh=me+YBY4AD+ZXDXVHVBMExee1u7kqrFZ6rraIx+yPtxg=; b=B Fib2krxq7HBhcBpAHGXlOLrJ9UPoY6JFqD/gUWzikkvRRwUuK6GifHEtISWWFYmc oKXVPOEN7CSEaEAIiOwGLU3aZZStM/OqY5H/IN8Ht84z9a6/wYpxynmV+KqMG7mv 8TBokthZH4TPR3UQOvn77r0hHcTSL5MQpYnk2KVZsyzsVq2sG9HpOtlggw2vhGql DsErKYD5XvGoPvusHXdAxEAbvFiaq1XMJLs7RaCdromDzh+YQXflCPOMTh2jOLkR JkceBMmzXPBRts+TYrUr5tz0DNTN428Cg+hMh8VLD3iWFnIkg2/PMvnFPnhe5eaW /ffOEZcyvCtKlmgj40UqQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeeggdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeforghtthgv ohcuuegvtggtrghtihcuoehphhhpsegsvggttggrthhirdgtohhmqeenucggtffrrghtth gvrhhnpeeihefgheevffevieevtdfhueffffegvdfgffdvkeehhfdtjeegleetuddvuefg geenucffohhmrghinhepvgigthgvrhhnrghlshdrihhopdhgihhthhhusgdrtghomhdpsg gvtggtrghtihdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehphhhpsegsvggttggrthhirdgtohhm X-ME-Proxy: Feedback-ID: i6f4c46c2:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 Oct 2023 12:02:09 -0400 (EDT) Message-ID: Date: Wed, 18 Oct 2023 18:02:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: it To: Karoly Negyesi , "internals@lists.php.net" References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Expose pdo_parse_params to userspace From: php@beccati.com (Matteo Beccati) Hi Karoly, Il 11/10/2023 17:03, Karoly Negyesi ha scritto: > Drupal has been using PDO for a long time now but as it doesn't have async > support, the project is adding a mysqli driver. A sticky point here is the > lack of support for named placeholders which are widely used in Drupal land > but mysqli doesn't support them. Currently the project is considering > parsing the SQL string in userspace to convert the named placeholders to > positional ones. This does seem like a waste because PDO already contains > battle tested, performant code to do this: pdo_parse_params. Exposing this > to userspace would solve the problem. What do you think? If the maintainers > of the project agree to the idea I can take a stab at coding this. It can't > be too hard (famous last words). TBH I'm not very excited to expose PDO (or other) internal functions to userland. The pdo_parse_params function works on a PDO statement, so I would expect you need a PDO statement to call its userland equivalent, unless some major refactoring takes place. Also, tangentailly related is the fact that the SQL parser is currently hardcoded to MySQL syntax[1] and I was planning to improve that. I had a working PR[2] to allow drivers to have their own SQL parser, but haven't yet managed to find time to go through the RFC process. References: [1] https://externals.io/message/114016 [2] https://github.com/php/php-src/pull/6852 Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/