DBD-mysql-3.002 on Digital Unix : bug

Donald Buczek <[email protected]>
Newsgroups gmane.comp.db.mysql.perl
Message-ID <[email protected]>
The current code assumes that sprintf on any system supports %llu in the 
format string which is not true.

Under Digital Unix 4.0F "make test" fails in several places. During the 
tests error messages like

  Argument "lu" isn't numeric in numeric eq (==) at t/40numrows.t line 97
  Argument "lu" isn't numeric in numeric eq (==) at t/40numrows.t line 119

are emitted. Test summary is

==============================================
Failed 33/37 tests, 10.81% okay
Failed Test   Stat Wstat Total Fail  Failed  List of Failed
-----------------------------------------------------------
t/40numrows.t               25    3  12.00%  7 14 21
t/ak-dbd.t                  90    1   1.11%  26
t/akmisc.t                 351    6   1.71%  17 24-25 49 81 341
t/mysql.t                   68    6   8.82%  4 10 28 62 66-67
t/mysql2.t                  37   33  89.19%  3-34 37
1 test and 14 subtests skipped.
Failed 5/20 test scripts, 75.00% okay. 49/897 subtests failed, 94.54% okay.
===============================================

After the following obvious dirty and unportable patch the tests succeed 
100%.

===============================================
*** 1.1    2006/04/20 10:50:50
--- mysql.xs    2006/04/20 11:31:20
***************
*** 570,576 ****
    if (imp_sth->row_num+1 ==  (my_ulonglong) -1)
      sprintf(buf, "%d", -1);
    else
!     sprintf(buf, "%llu", imp_sth->row_num);
 
    ST(0) = sv_2mortal(newSVpvn(buf, strlen(buf)));
 
--- 570,576 ----
    if (imp_sth->row_num+1 ==  (my_ulonglong) -1)
      sprintf(buf, "%d", -1);
    else
!     sprintf(buf, "%lu", imp_sth->row_num);
 
    ST(0) = sv_2mortal(newSVpvn(buf, strlen(buf)));
=================================================


Ciao
  Donald

-- 
Donald Buczek
[email protected]
Tel: +49 30 8413 1433


-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.