Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97221 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85745 invoked from network); 28 Nov 2016 23:16:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Nov 2016 23:16:44 -0000 Authentication-Results: pb1.pair.com header.from=adambaratz@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=adam.baratz@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.177 as permitted sender) X-PHP-List-Original-Sender: adam.baratz@gmail.com X-Host-Fingerprint: 209.85.217.177 mail-ua0-f177.google.com Received: from [209.85.217.177] ([209.85.217.177:32803] helo=mail-ua0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FE/37-19217-8DABC385 for ; Mon, 28 Nov 2016 18:16:40 -0500 Received: by mail-ua0-f177.google.com with SMTP id 20so160318266uak.0 for ; Mon, 28 Nov 2016 15:16:40 -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=NOTkcosL/046PEl3BUJtyjH9JxMAG+bbn3h7/ezZYGA=; b=WvbLFaspdSlFjJXNiqj3a9FivJRHykiuCJ7cIZMIETBDl+NdBsiPc7OXvCDRq2STXn ppCXzA65ud6pX5JIVd6ydGJxPW6zIEJOOBBmzSw3cb38KuXwa2OshNF60V1inUJqUtKk 51Gbl4onyR/Xy/TldIdgcyHqA+xIhzd+7FLX90/PFHP/ae0rZ3xXzfaeyv0K/ywu3uZe y8cBxc7w5aNV8Y6BMThHSxShVuLoJHjwI22pViVgGU4v1R7rrRlEIUYIRFXJGQsKwUnT 7R+X7WAPqrlc6SHKcFJHpzsA0Ho0FShaVBQ8QK2zcPZlDSE0DHM73q/PAKok8dHij0/6 tZsw== X-Gm-Message-State: AKaTC00Ffn/JjN6q17tTLm99ZBk9xOCK97I64zassRMH46jdNJqzlGGLAVI6iS5t+cAZ+Q== X-Received: by 10.176.82.71 with SMTP id j7mr14358016uaa.77.1480374997393; Mon, 28 Nov 2016 15:16:37 -0800 (PST) Received: from mail-vk0-f45.google.com (mail-vk0-f45.google.com. [209.85.213.45]) by smtp.gmail.com with ESMTPSA id 107sm14503987uas.13.2016.11.28.15.16.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Nov 2016 15:16:37 -0800 (PST) Received: by mail-vk0-f45.google.com with SMTP id 137so82645739vkl.0 for ; Mon, 28 Nov 2016 15:16:36 -0800 (PST) X-Received: by 10.31.7.200 with SMTP id 191mr9126169vkh.132.1480374996761; Mon, 28 Nov 2016 15:16:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.31.137.65 with HTTP; Mon, 28 Nov 2016 15:16:36 -0800 (PST) In-Reply-To: References: Date: Mon, 28 Nov 2016 18:16:36 -0500 X-Gmail-Original-Message-ID: Message-ID: To: Matteo Beccati Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a1143d318d104d1054264a9a6 Subject: Re: [PHP-DEV] Re: [RFC] Debugging PDO Prepared Statement Emulation v2 From: adambaratz@php.net (Adam Baratz) --001a1143d318d104d1054264a9a6 Content-Type: text/plain; charset=UTF-8 Hi, I would not use "Parsed SQL" though, as it's not just the result of > parsing. In fact it could effectively be what has been sent to the backend, > regardless of statement emulation... > I'd be happy to make the feature more specific. The "Parsed" line would only show with emulated prepares enabled, after execute() has been called. I'd prefer using "Parsed" because the language would be more specific. It would also correspond to pdo_parse_params(), the function which does the emulation. Basically, you'd never see this kind of example: SQL: "SELECT * FROM tbl WHERE x = ?" > Sent SQL: "SELECT * FROM tbl WHERE x = $1" > I haven't tested, but I'm pretty sure the feature could be implemented by adding this block below the first php_stream_printf() call in debugDumpParams(): /* show parsed SQL if emulated prepares enabled */ > /* pointers will be equal if PDO::query() was invoked */ > if (stmt->active_query_string != NULL && stmt->active_query_string != > stmt->query_string) { > php_stream_printf(out, "Parsed SQL: [%zd] %.*s\n", > stmt->active_query_stringlen, (int) stmt->active_query_stringlen, > stmt->active_query_string); > } Let me know what you think of this approach. If it sounds fine, I'll update the RFC. Thanks, Adam --001a1143d318d104d1054264a9a6--