php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65613 Bigint is truncated to 32bits even on 64bit machines
Submitted: 2013-09-04 10:06 UTC Modified: 2017-10-24 08:42 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: antoxa at corp dot badoo dot com Assigned:
Status: Suspended Package: ingres (PECL)
PHP Version: 5.5.3 OS: SLES 11.1, Kernel 2.6.32.59
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: antoxa at corp dot badoo dot com
New email:
PHP Version: OS:

 

 [2013-09-04 10:06 UTC] antoxa at corp dot badoo dot com
Description:
------------
php ingres-2.2.4

ingres version (that i could find):
$ cat version.rel
VW 2.5.1 (a64.lnx/162)NPTL
x100-gcc-OPTXPROF-64(branches/vw2.50) built on Jun 13 2012 10:28:34 with GCC 4.4.4 20100726 (Red Hat 4.4.4-13)


Bigint fields are truncated to 32bits even when on 64bit machines/php builds, i.e. when long is 64bits wide (and int is 32bits).

The issue seems to be an oversight really, attached patch just changes casts from II_INT4 to II_INT8 when value can fit into long.

Test script:
---------------
<?
// dl ingres.so here, open the connection to database
// create a table in this database with one bigint field
// insert 64bit value, for example 1055554784985141

$db = ingres_connect(...);
$res = ingres_query($db,
    "select bigint_field from some_table where bigint_field = " . 1055554784985141
);

var_dump(ingres_fetch_array($res));


Expected result:
----------------
array(2) {
  [1] => int(1055554784985141)
  'bigint_field' => int(1055554784985141)
}

Actual result:
--------------
array(2) {
  [1] => int(-2147483595)
  'bigint_field' => int(-2147483595)
}


Patches

ingres_bigint_on_64bit_machine.patch (last revision 2013-09-04 10:07 UTC by antoxa at corp dot badoo dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-24 08:42 UTC] kalle@php.net
-Status: Open +Status: Suspended
 [2017-10-24 08:42 UTC] kalle@php.net
The ingres package has not had any activity for 4 years, so its safe to say that its no longer in active development, if activity picks backup then the maintainer can re-open this report
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 02:01:29 2024 UTC