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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: peterh at criten dot org
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Mon May 06 02:01:31 2024 UTC