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} } );
}