|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesingres_bigint_on_64bit_machine.patch (last revision 2013-09-04 10:07 UTC by antoxa at corp dot badoo dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-10-24 08:42 UTC] kalle@php.net
-Status: Open
+Status: Suspended
[2017-10-24 08:42 UTC] kalle@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 08:00:01 2025 UTC |
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) }