Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

Report information
The Basics
Id: 81911
Status: resolved
Priority: 0/
Queue: DBI

People
Owner: Nobody in particular
Requestors: bohica [...] ntlworld.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.622_921
Fixed in: (no value)



Subject: The execute method returns an int for rows affected but this is inadequate especially on 64 bit platforms
re http://www.perlmonks.org/?node_id=1007766 The execute method requires an int to be returned but the affected rows could be a lot bigger than this especially on 64 bit platforms. The Perl IV is guaranteed to be big enough to hold the largest of and pointer to int so this would be better. However, changing the execute method would require a recompile of an DBDs and also if the prototype was changed as is any existing drivers would fail to compile without change. In the past we've added a new API to get around this (.e.g., methods which were changed to take an SV* instead of a char*). More background in the perlmonks link. DBD::ODBC and ODBC return an SQLLEN for SQLRowCount and SQLLEN is 8 bytes on 64 bit platforms. Martin -- Martin J. Evans Wetherby, UK
In the meantime you make DBD::ODBC warn if rows > max int (and $h->{Warn} is true) and return max int in that case. That, plus notes in docs and Changes should suffice for now. Also, perhaps the driver could implement a custom rows() method.
On Tue Dec 11 17:58:58 2012, TIMB wrote: Show quoted text
> In the meantime you make DBD::ODBC warn if rows > max int (and $h-
> >{Warn} is true) and
> return max int in that case. That, plus notes in docs and Changes > should suffice for now. > > Also, perhaps the driver could implement a custom rows() method.
All this has been done in DBD::ODBC 1.42_1. Martin -- Martin J. Evans Wetherby, UK
My current plan is to change the XS execute() to return the value of the DBIc_ROW_COUNT IV if the int returned by dbd_st_execute is > 0 and DBIc_ROW_COUNT > 0.
Fixed, or rather a workaround is provided, in DBI-1.633_92 I believe.
Closing this as resolved now. Thanks!