in reply to Same DBI version gives different output on different machines

Probably more important than the DBI version is the version of the DBD::mysql module, which handles the data exchange with mysql.

Also notice that count is a keyword in SQL (as in SELECT COUNT(*) FROM ..), so you're on the safe side when you quote the column name:

Select `count` from ...
Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^2: Same DBI version gives different output on different machines
by samarzone (Pilgrim) on Jan 25, 2010 at 14:11 UTC
    Thanks for your hint (DBD::mysql). It seems I am closer to the reason (but more confused).

    Machine-1 (with correct output) had DBD::mysql version 4.005 and machine-2 (with incorrect output) had DBD::version 3.0001_x.

    There is an entry in change-log of DBD::mysql 4.001 which says -

    Fix handling of negative integers bound to a column marked as SQL_INTEGER.
    [rt.cpan.org #18976], patch from Mike Schilli.

    We planned to install 4.00 (to check incorrect value) and then 4.001 (to check correct value) to make sure that the mentioned change is the one we are looking for. But we faced some strange thing. The script gave the desired output even with DBD::mysql version 4.00. We uninstalled it and installed 3.0005 and it also gave the desired output. Finally we installed 3.0000 but everything was working fine now. We manually removed DBD/mysql.pm and the mysql.so files installed with the module and reinstalled the 3.0000 version but unlike previously now we are getting the desired output. Although this solves the problem on our development servers I am keen to find out the reason.