On 03/10/16 22:20, Rowan Collins wrote:
> On 3 October 2016 19:11:52 BST, Adam Baratz <adambar...@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.

Firebird, oracle and mysql would have exactly the same problem. The
prepare SQL script is invalid so prepare fails. If it works for dblib
then I would consider THAT the bug. Parameters can only be assigned to
fields identified in the prepared SQL. In this case :null has nothing to
identify what it is to be prepared to populate.

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to