Re: patch: selectcol_arrayref & MaxRows with multiple columns
Tim Bunce <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.dbi.sybase.devel |
|---|---|
| Message-ID | <[email protected]> |
Thanks, applied!
Tim.
On Mon, Mar 01, 2010 at 04:37:42PM +0000, Vernon Lyon wrote:
>
> If selectcol_arrayref is called with MaxRows and multiple Columns, the result is limited not by MaxRows rows but by MaxRows values.
>
> If MaxRows is 100 and you're requesting 2 columns you only get 50 rows!
>
> Patch below:
>
> Index: dbi/DBI.pm
> ===================================================================
> --- dbi/DBI.pm (revision 13831)
> +++ dbi/DBI.pm (working copy)
> @@ -1655,7 +1655,7 @@
> Â Â Â Â Â Â Â }
> Â Â Â Â Â Â Â my @col;
> Â Â Â Â Â Â Â if (my $max = $attr->{MaxRows}) {
> -Â Â Â Â Â Â Â Â Â Â push @col, @values while @col<$max && $sth->fetch;
> +Â Â Â Â Â Â Â Â Â Â push @col, @values while 0 < $max-- && $sth->fetch;
> Â Â Â Â Â Â Â }
> Â Â Â Â Â Â Â else {
> Â Â Â Â Â Â Â Â Â Â Â push @col, @values while $sth->fetch;
>
>
> _________________________________________________________________
> Do you have a story that started on Hotmail? Tell us now
> http://clk.atdmt.com/UKM/go/195013117/direct/01/