Bug->Doc #48856 [Opn->Csd]: emulated prepared statements allow multiple parameters of the same name

From: Date: Tue, 28 Sep 2021 12:25:35 +0000
Subject: Bug->Doc #48856 [Opn->Csd]: emulated prepared statements allow multiple parameters of the same name
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-19233@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=48856&edit=1 ID: 48856 Updated by: cmb@php.net Reported by: dhammari at q90 dot com Summary: emulated prepared statements allow multiple parameters of the same name -Status: Open +Status: Closed -Type: Bug +Type: Documentation Problem Package: PDO related Operating System: Linux 2.6.27-gentoo-r8 PHP Version: 5.2.10 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: > You're allowed to reuse parameters with emulated prepares. I > believe that's specifically what's being called out here. The > easiest thing to do, honestly, would be to update the > documentation to that end. I aggre. The documentation now says[1]: | You cannot use a named parameter marker of the same name more | than once in a prepared statement, unless emulation mode is on. So this is resolved. See also feature request #76647 regarding implementation improvements. [1] <https://www.php.net/manual/en/pdo.prepare.php> Previous Comments: ------------------------------------------------------------------------ [2021-09-28 10:41:09] cmb@php.net Related To: Bug #69257 ------------------------------------------------------------------------ [2017-10-24 18:51:48] adambaratz@php.net You're allowed to reuse parameters with emulated prepares. I believe that's specifically what's being called out here. The easiest thing to do, honestly, would be to update the documentation to that end. Otherwise, this would have be changed for the next minor rev since it would technically be a BC break. Other drivers have built-in inflexibility here, so I wouldn't suggest making any other changes. Moving this to PDO Core since that's where the emulation code lives. ------------------------------------------------------------------------ [2015-09-26 01:33:33] a791446794 at 163 dot com I want this feature too! When sql has subquey with the same condition,it is fairly that use the same :token will be maintainable and efficient. ------------------------------------------------------------------------ [2009-11-16 13:42:59] dbs@php.net I've referred this bug to the PDO discussion list, as there are ongoing discussions about the future design of PDO and this bug seems to be pertinent to that discussion. ------------------------------------------------------------------------ [2009-09-24 02:59:16] dbs@php.net Yes, it was a limitation back then - and while it might work for some PDO drivers, I believe the problem was that it was not guaranteed to work with all PDO drivers - and therefore discouraged. It would be best for us to talk to a current PDO developer to get the real deal on the current situation. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=48856 -- Edit this bug report at https://bugs.php.net/bug.php?id=48856&edit=1

« previous php.doc.bugs (#19233) next »