Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101058 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68786 invoked from network); 5 Nov 2017 00:03:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2017 00:03:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes.schlueter@oracle.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes.schlueter@oracle.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain oracle.com from 156.151.31.81 cause and error) X-PHP-List-Original-Sender: johannes.schlueter@oracle.com X-Host-Fingerprint: 156.151.31.81 userp1040.oracle.com Received: from [156.151.31.81] ([156.151.31.81:46225] helo=userp1040.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/53-09857-F455EF95 for ; Sat, 04 Nov 2017 19:03:28 -0500 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vA503Ia9011512 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 5 Nov 2017 00:03:19 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vA503HsE019054 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 5 Nov 2017 00:03:17 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vA503GWk011453; Sun, 5 Nov 2017 00:03:16 GMT Received: from kuechenschabe.fritz.box (/46.244.165.144) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 04 Nov 2017 17:03:15 -0700 Message-ID: <1509840184.22186.14.camel@oracle.com> To: Matteo Beccati , Scott Arciszewski Cc: PHP Internals Date: Sun, 05 Nov 2017 01:03:04 +0100 In-Reply-To: <513ec8cf-6690-0bfa-bf20-b3a38620036b@beccati.com> References: <7e7d69c9-8383-9cd0-9a54-0e7e4bb80775@beccati.com> <513ec8cf-6690-0bfa-bf20-b3a38620036b@beccati.com> Organization: Oracle Corporation - MySQL Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0022.oracle.com [141.146.126.234] Subject: Re: [PHP-DEV] Idea: PDO - Single-round-trip prepared statements From: johannes.schlueter@oracle.com (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Sa, 2017-11-04 at 08:28 +0100, Matteo Beccati wrote: > Hi, >=20 > On 03/11/2017 21:25, Scott Arciszewski wrote: > >=20 > > MySQL calls it an X Protocol, apparently. > >=20 > > https://dev.mysql.com/doc/internals/en/x-protocol-use-cases-use-cas > > es.html#x-protocol-use-cases-prepared-statements-with-single-round- > > trip > OK, which is something that neither libmysqlclient nor mysqlnd seem > to support. The X Protocol is supported via https://pecl.php.net/package/mysql_xdevapi=C2=A0which adds a complete new set of APIs with higher level CRUD stuff. We won't put it directly in mysqlnd or such as it has different semantics in different areas making the protocol no simple drop-in replacement. It's however based on Google protobuf, thus it is relatively straight forward to implement (or one could build upon based on the DevAPI) maybe doing a PDO prototype might be interesting ... Aside from that: "true" prepared statements are improved quite a lot in MySQL 8 (currently in RC), but with the "old" protocol still need the extra roundtrip. In general: When doing something in the area one should also look into more "advanced" abstractions. One thing I often see requested are "variadic binds" for stuff like "WHERE field IN (?...)" which isn't supported natively (50% of the way can be done by faking this by binding to a JSON array) Maybe there are other ideas what can be done liberating from concepts from the 1970ies. With the X protocol we (MySQL) have liberties to extend this, which we didn't had before ... :) johannes