Bug #68638 [Com]: pg_update() fails to store infinite values

From: Date: Wed, 04 Feb 2015 00:24:21 +0000
Subject: Bug #68638 [Com]: pg_update() fails to store infinite values
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190456@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68638&edit=1 ID: 68638 Comment by: william dot welter at 4linux dot com dot br Reported by: joerg dot ludwig at iserv dot eu Summary: pg_update() fails to store infinite values Status: Open Type: Bug Package: PostgreSQL related Operating System: Debian Linux PHP Version: 5.4.36 Block user comment: N Private report: N New Comment: The problem is that on source code, when a PHP string is passed to a float field on database, this string is checked with a regex that is not aware about "infinity" values. See the the patch that i send. Previous Comments: ------------------------------------------------------------------------ [2014-12-23 14:06:34] joerg dot ludwig at iserv dot eu Description: ------------ pg_update() fails to store infinite values. Test script: --------------- $dbh = pg_connect("dbname=test"); pg_update($dbh, "test", ["ping" => INF], ["id" => 42]); pg_update($dbh, "test", ["ping" => "INF"], ["id" => 42]); Expected result: ---------------- pg_update() (and pg_insert()) should be able to store infinite values (INF and -INF). In PostgreSQL itself it works: UPDATE test SET ping = 'INF' WHERE id = 42; Actual result: -------------- PHP Warning: pg_update(): ERROR: column "inf" does not exist LINE 1: UPDATE "test" SET "ping"=INF WHERE "id"=42... ^ in Command line code on line 1 PHP Notice: pg_update(): 'INF' does not match with '^([+-]{0,1}[0-9]+)|([+-]{0,1}[0-9]*[\.][0-9]+)|([+-]{0,1}[0-9]+[\.][0-9]*)$' in Command line code on line 1 PHP Notice: pg_update(): Expects NULL, string, long or double value for PostgreSQL 'float4' (ping) in Command line code on line 1 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68638&edit=1

« previous php.bugs (#190456) next »