> -----Original Message-----
> From: Michael Higgins [mailto:[EMAIL PROTECTED]
> SQL::Abstract::Limit _seems_ responsible for the errors. If I
> pass the reference, it carps about ORDER BY SCALAR(0x85d842c)
> DESC and if I don't, then it complains bad column order spec:
> "Invoice #" DESC.
[8<]
> However, from SQL::Abstract::Limit:
>
> my $ref = ref $order;
>
> my @order;
>
> CASE: {
> @order = @$order, last CASE if $ref eq 'ARRAY';
> @order = ( $order ), last CASE unless $ref;
> @order = ( $$order ), last CASE if $ref eq 'SCALAR';
> Carp::croak __PACKAGE__ . ": Unsupported data struct $ref
> for ORDER BY"; }
> foreach my $spec ( @order )
> {
So, I altered the module...
my @spec;
my ($col, $up);
if (! ref $spec){
@spec = split ' ', $spec;
Carp::croak( "bad column order spec: $spec" ) if @spec > 2;
push( @spec, 'ASC' ) unless @spec == 2;
( $col, $up ) = @spec; # or maybe down
}else {
my $lastspace = (rindex $$spec, ' ') +1;
$col = substr $$spec, 0, $lastspace;
$up = substr $$spec, $lastspace;
}
Obviously, this ain't a real patch. But, it got me around the problem... I
think. At least, I believe I've isolated the glitch...
Is there another way to honor the 'pass this sql through like it is' for
order_by with paged results?
Cheers,
--
Michael Higgins
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/