Re: [PATCH - PR] Disable ATTR_EMULATE_PREPARES by default for PDO_Mysql

From: Date: Mon, 03 Nov 2014 11:55:52 +0000
Subject: Re: [PATCH - PR] Disable ATTR_EMULATE_PREPARES by default for PDO_Mysql
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On 03/11/2014 12:40, Rowan Collins wrote:
> When using a one-shot call to query() with multiple statements (e.g.
> create temp table; populate temp table; select results) it's actually
> necessary with Postgres to switch on emulation, and for that
> emulation to allow multiple queries even though the DBMS wouldn't. We
> discovered this in moving from ext/postgres, where pg_query() doesn't
> attempt to prepare the query, so allows strings containing multiple
> statements. We therefore needed a compatible mode in order to switch
> to PDO.

Both pg_query and EMULATE_PREPARES in pdo_pgsql use PQexec, that allows
multiple statements being sent at once. Going from memory it is also
used with PGSQL_DISABLE_PREPARES (5.6+) if there are no bound parameters.


Cheers
-- 
Matteo Beccati

Development & Consulting - http://www.beccati.com/


Thread (40 messages)

« previous php.internals (#78572) next »