Menu

#16 Integer value not always correct

open
nobody
None
7
2011-08-01
2011-07-29
Anonymous
No

The correct integer value isn't always returned.

For example:
select 1 as test

75% of the time, this returns 1. The rest of the time is returns a random number, i.e. 19946824975

Everything else works fine, but integers are flakey

OS: OpenSUSE 11.4 x64
PHP 5.3
ODBTP 1.1.4
SQL Server 2000

Discussion

  • Robert Twitty

    Robert Twitty - 2011-07-29

    Did you look at the file README.64bitOS before compiling?

     
  • Anonymous

    Anonymous - 2011-07-30

    Yes. Even patched the header file so it compiles on both 32 and 64 bit systems...
    #ifdef _LP64 #define _C_LONG_64_ 1 #endif

     
  • Robert Twitty

    Robert Twitty - 2011-07-30

    Can you post the script you are using for the test? Also, could you perform a similar test with odbtpcli (ODBTP client utility)?

     
  • Anonymous

    Anonymous - 2011-07-31

    I've confirmed that this problem only happens via the web, and not via the CLI. Rather than send you the connection object and result object wrappers, I made a simple test script that replicates the problem:

    // connection string commented out for protection
    $conn = odbtp_connect('xxx.xx.1.170','DRIVER={SQL Server};SERVER=xx.xx.1.170;UID=xxxx;PWD=xxxx;DATABASE=xxx_tst;');

    $rs = odbtp_query('select 1 as test');

    $ret = odbtp_fetch_object($rs);

    var_dump($ret);

    odbtp_close($conn);

    ==============================
    The result from CLI is always:
    object(stdClass)#1 (1) { ["test"]=> int(1) }

    Run via webpage (after 7 page refreshes):
    object(stdClass)#1 (1) { ["test"]=> int(140591459467265) }

     
  • Anonymous

    Anonymous - 2011-08-01

    Also verified the odbtpcli client utlity works fine:

    test.txt

    xxx.xx.1.170
    DRIVER={SQL Server};SERVER=xxx.xxx.1.170;UID=xxx;PWD=xxxxx;DATABASE=xxx_tst;
    select 1 as test

    output is consistently:

    C:\odbtp-1.1.4\winclient>odbtpcli test.txt
    Version: ODBTP/1.1

    "test"
    1

     
  • Anonymous

    Anonymous - 2011-08-01

    Fixed by recompiling using latest code in CVS repository, however original issue still not resolved.

     
  • Robert Twitty

    Robert Twitty - 2011-08-02

    Does this problem occur with odbtp_fetch_array() or odbtp_fetch_assoc()?

     
  • Anonymous

    Anonymous - 2011-08-09

    Never tried with odbtp_fetch_array or odbtp_fetch_assoc. I'll roll back to the previous version when I get a chance.

     

Log in to post a comment.

MongoDB Logo MongoDB