[Bps-public-commit] dbix-searchbuilder branch, master, updated. 1.56_03-6-gb117b41
Alex Vandiver
alexmv at bestpractical.com
Fri Aug 27 15:40:38 EDT 2010
The branch, master has been updated
via b117b41ea95efa5ee191bf825a1cbb2b84ce5e29 (commit)
from 188270910afedf4039af96f6c772b922be9b3872 (commit)
Summary of changes:
SearchBuilder/Handle/Oracle.pm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
- Log -----------------------------------------------------------------
commit b117b41ea95efa5ee191bf825a1cbb2b84ce5e29
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Fri Aug 27 15:26:32 2010 -0400
Oracle: Use ROW_NUMBER() to propagate row ordering from inside the DISTINCT
diff --git a/SearchBuilder/Handle/Oracle.pm b/SearchBuilder/Handle/Oracle.pm
index 3f8be13..de0a6bf 100755
--- a/SearchBuilder/Handle/Oracle.pm
+++ b/SearchBuilder/Handle/Oracle.pm
@@ -262,7 +262,7 @@ sub DistinctQuery {
];
my $group = $sb->_GroupClause;
my $order = $sb->_OrderClause;
- $$statementref = "SELECT main.* FROM ( SELECT main.id FROM $$statementref $group $order ) distinctquery, $table main WHERE (main.id = distinctquery.id)";
+ $$statementref = "SELECT main.* FROM ( SELECT main.id, row_number() over( $order ) sortorder FROM $$statementref $group ) distinctquery, $table main WHERE (main.id = distinctquery.id) ORDER BY distinctquery.sortorder";
} else {
# Wrapp select query in a subselect as Oracle doesn't allow
# DISTINCT against CLOB/BLOB column types.
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list