php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37459 pg_convert fails with bigint
Submitted: 2006-05-16 10:07 UTC Modified: 2006-05-16 13:06 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: peterh at criten dot org Assigned:
Status: Not a bug Package: PostgreSQL related
PHP Version: 5.1.4 OS: FreeBSD 5
Private report: No CVE-ID: None
 [2006-05-16 10:07 UTC] peterh at criten dot org
Description:
------------
I noticed when I send pg_convert a large integer intended for a bigint column, it returns an incorrect (and negative) value.



Reproduce code:
---------------
$data['size'] = 33971734946;
$result = pg_convert($database,$table,$data);

print_r($result);

Expected result:
----------------
Array ( [size] => 33971734946 )

Actual result:
--------------
Array ( [size] => -388003422 )

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-16 13:06 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Integers on 32 bit systems in PHP are limited to 2.14 billion. 
To avoid the limitation make the assignment operation use 
strings like this:

$data['size'] = '33971734946';
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC