[open-ils-commits] [GIT] Evergreen ILS branch master updated. beda681b74c9ca4a753388ff14a6ec17b846a20d
Evergreen Git
git at git.evergreen-ils.org
Tue Oct 25 11:52:21 EDT 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via beda681b74c9ca4a753388ff14a6ec17b846a20d (commit)
from 9df73cf0035b9f9f804cdab74719bad5bdc1a2d2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit beda681b74c9ca4a753388ff14a6ec17b846a20d
Author: Mike Rylander <mrylander at gmail.com>
Date: Tue Oct 25 11:53:25 2011 -0400
Provide a QP modifier for sorting NULLS FIRST in the core SQL
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
index f5cb67d..41ed64c 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
@@ -455,6 +455,8 @@ __PACKAGE__->add_search_filter( 'sort' );
# modifies core query, not configurable
__PACKAGE__->add_search_modifier( 'descending' );
__PACKAGE__->add_search_modifier( 'ascending' );
+__PACKAGE__->add_search_modifier( 'nullsfirst' );
+__PACKAGE__->add_search_modifier( 'nullslast' );
__PACKAGE__->add_search_modifier( 'metarecord' );
__PACKAGE__->add_search_modifier( 'metabib' );
@@ -549,6 +551,9 @@ sub toSQL {
my $desc = 'ASC';
$desc = 'DESC' if ($self->find_modifier('descending'));
+ my $nullpos = 'NULLS LAST';
+ $nullpos = 'NULLS FIRST' if ($self->find_modifier('nullsfirst'));
+
if (grep {$_ eq $sort_filter} @{$self->QueryParser->dynamic_sorters}) {
$rank = "FIRST(mrd.attrs->'$sort_filter')"
} elsif ($sort_filter eq 'create_date') {
@@ -668,7 +673,7 @@ SELECT $key AS id,
$combined_dyn_filters
$flat_where
GROUP BY 1
- ORDER BY 4 $desc NULLS LAST, 5 DESC NULLS LAST, 3 DESC
+ ORDER BY 4 $desc $nullpos, 5 DESC $nullpos, 3 DESC
LIMIT $core_limit
SQL
-----------------------------------------------------------------------
Summary of changes:
.../Application/Storage/Driver/Pg/QueryParser.pm | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list