Req #36874 [Com]: PDO_PGSQL quote null change

From: Date: Mon, 04 Nov 2013 22:28:44 +0000
Subject: Req #36874 [Com]: PDO_PGSQL quote null change
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182597@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=36874&edit=1 ID: 36874 Comment by: willfitch@php.net Reported by: stochnagara at hotmail dot com Summary: PDO_PGSQL quote null change Status: Assigned Type: Feature/Change Request Package: PDO related Operating System: win xp PHP Version: 5.1.3RC1 Assigned To: willfitch Block user comment: N Private report: N New Comment: The only way we'll be able to implement this feature is to change the quote function at the PDO layer to accept a zval. However, this will require changes in each of the drivers. Previous Comments: ------------------------------------------------------------------------ [2013-10-29 19:09:30] willfitch@php.net The issue with the specific case is that PDO converts the NULL to an empty string prior to pdo_pgsql has the opportunity to analyze it. In pgsql_handle_quoter, the unquoted value is an empty string. I'll look at the impact this would have on other drivers to pass NULL and PDO_PARAM_NULL for paramtype. ------------------------------------------------------------------------ [2006-03-27 16:27:27] stochnagara at hotmail dot com Description: ------------ Currently PDO quotes null value as a string '' . I suggest to change this behaviour and quote null as sql NULL. Reproduce code: --------------- <? $pdo = new PDO('pgsql:...', 'root', ''); var_dump ($pdo->quote (null)); Expected result: ---------------- null Actual result: -------------- string ('') ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=36874&edit=1

« previous php.bugs (#182597) next »