php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60902 select integer8 from data base don`t work correctly
Submitted: 2012-01-27 14:10 UTC Modified: -
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: V dot Bulov at VAZ dot ru Assigned:
Status: Open Package: Ingres II related
PHP Version: 5.3.9 OS: Linux kpl 3.2.1-3.fc16.x86_64
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-01-27 14:10 UTC] V dot Bulov at VAZ dot ru
Description:
------------
Sorry my english please!

After change on my computer from fc15.i686 to fc16.x86_64

i have problem with int8 on php program
 

I found  in  ingres.c


                  case 4:
                        value_long = (long) *((II_INT4 *) columnData->dv_value);
                        break;
#if defined(IIAPI_VERSION_4)
                    case 8:
                        /* PHP does not support BIGINT/INTEGER8 so we have to return */
                        /* values greater/smaller than the max/min size of a LONG value as a string */
                        /* Anyone wanting to manipulate this value can use PECL big_int */
                        if ((*((ingres_int64 *) columnData->dv_value) > LONG_MAX ) ||
                            (*((ingres_int64 *) columnData->dv_value) < LONG_MIN ))
                        {
                            value_long_long = *((ingres_int64 *) columnData->dv_value);
                            sprintf(value_long_long_str, "%lld\0", value_long_long);
                            value_long_long_str_len = strlen(value_long_long_str);
                        }
                        else
                        {
//                            value_long = (long) *((II_INT4 *) columnData->dv_value);
                            value_long = (long) *((II_INT8 *) columnData->dv_value);
                        }
                        break;
#endif
                    default:

after change II_INT4 on II_INT8 in my php program all work corectly


Test script:
---------------
before 

stdClass Object
(
    [acc_key] => -164999
)

after

stdClass Object                                             
(                                  [acc_key]=>1044001000020000                                                                                        
)  

Expected result:
----------------
1044001000020001

Actual result:
--------------
1044001000020001

Patches

ingres.c (last revision 2012-01-27 14:12 UTC by V dot Bulov at VAZ dot ru)

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Oct 18 04:01:27 2019 UTC