Integer value not always correct
Brought to you by:
mcguyver90,
rtwitty
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
Did you look at the file README.64bitOS before compiling?
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Yes. Even patched the header file so it compiles on both 32 and 64 bit systems...
#ifdef _LP64 #define _C_LONG_64_ 1 #endif
Can you post the script you are using for the test? Also, could you perform a similar test with odbtpcli (ODBTP client utility)?
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
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) }
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
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
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Fixed by recompiling using latest code in CVS repository, however original issue still not resolved.
Does this problem occur with odbtp_fetch_array() or odbtp_fetch_assoc()?
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Never tried with odbtp_fetch_array or odbtp_fetch_assoc. I'll roll back to the previous version when I get a chance.