http://www.perlmonks.org?node_id=1008082


in reply to Overflow of $DBI::rows

When DBD::ODBC is built 64 bit and has access to the correct header files SQLRowCount (the ODBC API to retrieve rows affected) should return an SQLLEN which on 64 bit platforms is 8 bytes. However, the DBI XS interface to DBD::ODBC has:

int dbd_st_execute( SV *sth, imp_sth_t *imp_sth)

and dbd_db_execute is supposed to return the rows affected. There are also other places in DBD::ODBC where the affected rows is cast to an int. I think fixes would be required in both DBI and DBD::ODBC. See also:

dbd_xsh.h:int dbd_st_execute _((SV *sth, imp_sth_t *imp_sth));

in dbd_xsh.h of DBI.

Replies are listed 'Best First'.
Re^2: Overflow of $DBI::rows
by mbethke (Hermit) on Dec 11, 2012 at 01:47 UTC

    Actually these ints should automatically 64 bits on any sane compiler where SQLLONG would be 64 bits, even if the standard doesn't require it. For clarity they should be fixed to size_t where negative values aren't used to signal errors, although I don't think any of them could be at fault here.

      They cannot be size_t for a start because they have to be able to contain negative values. I cannot comment as to what you believe is a sane compiler but ints and long ints on Windows 64 are 32 bits.