Skip Menu |

This queue is for tickets about the CatalystX-CRUD-Model-RDBO CPAN distribution.

Report information
The Basics
Id: 46904
Status: resolved
Priority: 0/
Queue: CatalystX-CRUD-Model-RDBO

People
Owner: Nobody in particular
Requestors: cpan [...] bluepolka.net
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.20
Fixed in: (no value)



sub CatalystX::CRUD::Model::RDBO::_join_with_table_prefix() fails to properly join multi-column sort orders for PostgreSQL 8.3. It appears to erroneously leave out the required comma between the columns (eg., "ORDER BY t1.student_id DESC t1.label DESC"). Example from my db log: 2009-06-12 15:05:28.860 MDT [30782] ed 127.0.0.1(56692) sdr ERROR: syntax error at or near "t1" at character 158 2009-06-12 15:05:28.860 MDT [30782] ed 127.0.0.1(56692) sdr STATEMENT: SELECT t1.id, t1.student_id, t1.layout_id, t1.style_id, t1.creator_id, t1.label, t1.created FROM transcript t1 ORDER BY t1.student_id DESC t1.label DESC LIMIT 50 OFFSET 0 I've attached a patch that works for this case, but haven't done any regression testing. Linux davy 2.6.24-19-generic #1 SMP Wed Jun 18 14:15:37 UTC 2008 x86_64 GNU/Linux
Subject: RDBO.pm.diff
*** /usr/local/share/perl/5.8.8/CatalystX/CRUD/Model/RDBO.pm.dist 2009-06-12 15:18:42.000000000 -0600 --- /usr/local/share/perl/5.8.8/CatalystX/CRUD/Model/RDBO.pm 2009-06-12 18:26:41.000000000 -0600 *************** *** 477,482 **** sub _join_with_table_prefix { my ( $self, $q, $prefix ) = @_; ! return join( ' ', ! map { $prefix . '.' . $_->[0], $_->[1] } map { [%$_] } @{ $q->{sort_order} } ); } --- 477,482 ---- sub _join_with_table_prefix { my ( $self, $q, $prefix ) = @_; ! return join( ', ', ! map { $prefix . '.' . $_->[0] . ' ' . $_->[1] } map { [%$_] } @{ $q->{sort_order} } ); }
Subject: Re: [rt.cpan.org #46904]
Date: Sat, 13 Jun 2009 21:50:39 -0500
To: bug-CatalystX-CRUD-Model-RDBO [...] rt.cpan.org
From: Peter Karman <peter [...] peknet.com>
Ed Loehr via RT wrote on 6/12/09 7:37 PM: Show quoted text
> sub CatalystX::CRUD::Model::RDBO::_join_with_table_prefix() fails to > properly join multi-column sort orders for PostgreSQL 8.3. It appears > to erroneously leave out the required comma between the columns (eg., > "ORDER BY t1.student_id DESC t1.label DESC"). >
Show quoted text
> I've attached a patch that works for this case, but haven't done any > regression testing.
Thanks, Ed. Fixed and uploaded with tests to CPAN as version 0.21. -- Peter Karman . http://peknet.com/ . peter@peknet.com