Re: Fwd: [PHP-BUG] Bug #73234 [NEW]: emulated statements let value dictate parameter type
| From: | Rowan Collins | Date: | Mon, 03 Oct 2016 21:20:17 +0000 |
| Subject: | Re: Fwd: [PHP-BUG] Bug #73234 [NEW]: emulated statements let value dictate parameter type | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-96200@lists.php.net to get a copy of this message | ||
On 3 October 2016 19:11:52 BST, Adam Baratz <adambaratz@php.net> wrote:
>Test script:
>---------------
>$db = new PDO(...);
>
>$stmt = $db->prepare("SELECT :null");
>$stmt->bindValue(':null', null, PDO::PARAM_NULL);
>$stmt->execute();
>var_dump($stmt->fetchAll()); // NULL
Well, I'm pretty sure Postgres won't be affected either way, because its type system is
such that you can't prepare a query where the types of parameters can't be decided yet. A
query like this simply gives an error.
Regards,
--
Rowan Collins
[IMSoP]