Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78570 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19615 invoked from network); 3 Nov 2014 09:18:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Nov 2014 09:18:25 -0000 Authentication-Results: pb1.pair.com header.from=php@beccati.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php@beccati.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain beccati.com designates 176.9.114.167 as permitted sender) X-PHP-List-Original-Sender: php@beccati.com X-Host-Fingerprint: 176.9.114.167 spritz.beccati.com Received: from [176.9.114.167] ([176.9.114.167:33992] helo=mail.beccati.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/21-08476-F5847545 for ; Mon, 03 Nov 2014 04:18:24 -0500 Received: (qmail 8938 invoked from network); 3 Nov 2014 09:18:19 -0000 Received: from home.beccati.com (HELO ?192.168.1.202?) (88.149.176.119) by mail.beccati.com with SMTP; 3 Nov 2014 09:18:19 -0000 Message-ID: <54574850.2020200@beccati.com> Date: Mon, 03 Nov 2014 10:18:08 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Ferenc Kovacs , Rasmus Lerdorf CC: Anthony Ferrara , PHP Internals References: <543FE883.2070401@lerdorf.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PATCH - PR] Disable ATTR_EMULATE_PREPARES by default for PDO_Mysql From: php@beccati.com (Matteo Beccati) Hi all Resuming this once again after Anthony's blog post... On 16/10/2014 18:10, Ferenc Kovacs wrote: > On Thu, Oct 16, 2014 at 5:47 PM, Rasmus Lerdorf wrote: >> I do agree that the default should probably be server-side since it is >> the least surprising. We just need to make it very very clear in the >> upgrade doc that this change will likely slow down peoples' apps and >> show them how to turn client-side prepares back on. >> >> -Rasmus >> > > I don't think we should remove the option, just change the defaults, and > most people would be fine switching back to the emulation, but it should be > their conscious decision imo. Yes. For the record, pdo_pgsql and pdo_mysql seem to be the only PDO drivers that can effectively emulate prepares. As far as I could tell, the others ignore the attribute. For pgsql the default is to use server-side prepares, so I'd be all for making both work consistently by default. However, I think PDO is fundamentally flawed in enforcing the use of prepared statements even when 99% of the times the queries issued by a PHP script need only to be executed once. It surely is a waste of resources having to allocate a prepared query, execute it and deallocate it each and every time. I certainly wish there was something in the mysql client/protocol similar to PQexecParams, which would be the best of both worlds. Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/