Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97231 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27288 invoked from network); 30 Nov 2016 22:48:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Nov 2016 22:48:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=adam.baratz@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=adambaratz@php.net; sender-id=unknown Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: adam.baratz@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-ua0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:36670] helo=mail-ua0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0E/05-14267-0475F385 for ; Wed, 30 Nov 2016 17:48:33 -0500 Received: by mail-ua0-f170.google.com with SMTP id b35so229073277uaa.3 for ; Wed, 30 Nov 2016 14:48:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=czsZS7QRnA+f0lzATeC+72PqXjEgDmArooqstpqgY0o=; b=MXWID5KeprJBMapFr71Tj8OTpgxZutMCr5cXE+q4RcqUaNU8ELA/Lgf3TIb4mHx9x4 SF+3OajjCnrPKCCAkCr0siJgsiMX5wQBzI5IioZyvSo+YK/dclzI/pJ53cRt55Rchyo7 mSeMoo4eYc7o7yfQPImm5FLx80HS8m3/OkJ+qy4bcDpelHlGkmwD3FWHM0OEPnG9PTDq h0NVQy9lZ9KDydl32Auo55It6sTK3XkMZAj847u5Z1oltyObhCulcq6Zq9jLw7xSXr0J utr79PY5abom3JuidRxYW+epi7iUaw6ydml+5HsAEJgkL7iF6PiO9WwVXCL6yEygTlu6 24sA== X-Gm-Message-State: AKaTC01le8Gbicc+HqTCel8dELp7uhZ/vY6NDXToi+WK1B/ENWFIRad979xIN2gjG/E1xA== X-Received: by 10.159.33.1 with SMTP id 1mr26563838uab.134.1480546110382; Wed, 30 Nov 2016 14:48:30 -0800 (PST) Received: from mail-ua0-f181.google.com (mail-ua0-f181.google.com. [209.85.217.181]) by smtp.gmail.com with ESMTPSA id b7sm16897652uab.15.2016.11.30.14.48.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Nov 2016 14:48:30 -0800 (PST) Received: by mail-ua0-f181.google.com with SMTP id b35so229072977uaa.3 for ; Wed, 30 Nov 2016 14:48:30 -0800 (PST) X-Received: by 10.159.32.133 with SMTP id 5mr25745295uaa.145.1480546109877; Wed, 30 Nov 2016 14:48:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.31.54.81 with HTTP; Wed, 30 Nov 2016 14:48:29 -0800 (PST) In-Reply-To: <7eaa3b8f-7e21-a50c-946e-3f721db09a10@beccati.com> References: <7eaa3b8f-7e21-a50c-946e-3f721db09a10@beccati.com> Date: Wed, 30 Nov 2016 17:48:29 -0500 X-Gmail-Original-Message-ID: Message-ID: To: Matteo Beccati Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=94eb2c0b6202f3f5a105428c8083 Subject: Re: [PHP-DEV] Re: [RFC] Debugging PDO Prepared Statement Emulation v2 From: adambaratz@php.net (Adam Baratz) --94eb2c0b6202f3f5a105428c8083 Content-Type: text/plain; charset=UTF-8 Hi, > Basically, you'd never see this kind of example: > > > > SQL: "SELECT * FROM tbl WHERE x = ?" > >> Sent SQL: "SELECT * FROM tbl WHERE x = $1" > >> > > why not? That's what active_query_string contains e.g. in pdo_pgsql w/o > emulate prepares. Which is more or less what has been sent to the > server, unless cursors are used. I don't see why it is deemed to be > not-useful or less useful than emulated prepares. > active_query_string is only set with emulated prepares. I tried my patch with pdo_pgsql. "Sent SQL" doesn't appear with real prepares. I put it up here, with tests, if it'll help try it out: https://github.com/adambaratz/php-src/commit/a030d2f4e6a13f3e6c10484fb5dbc4e8be6576c6 I'll incorporate it, and the content of this subthread, in the RFC when I get my next free five minutes. :) In fact it would come in very handy for extended tests of a bugfix I > have in the pipeline. > I'm not sure how to get the query with the $1. My understanding of pdo_pgsql/pgsql_stmt_execute() is that it creates some PG-specific data structures for prepared statements. Since they're attached to a pdo_pgsql_stmt value, you'd have to write some driver-specific code to get them out. Maybe there's a simple way to do what you're describing, but my instinct is that it would be better to keep it out-of-scope for this RFC. Thanks, Adam --94eb2c0b6202f3f5a105428c8083--