[Bast-commits] r8120 - in
DBIx-Class/0.08/branches/mssql_limit_regression: lib/DBIx/Class t
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Tue Dec 15 23:38:05 GMT 2009
Author: ribasushi
Date: 2009-12-15 23:38:04 +0000 (Tue, 15 Dec 2009)
New Revision: 8120
Modified:
DBIx-Class/0.08/branches/mssql_limit_regression/lib/DBIx/Class/SQLAHacks.pm
DBIx-Class/0.08/branches/mssql_limit_regression/t/746mssql.t
Log:
Do not realias tables in the RNO subqueries
Modified: DBIx-Class/0.08/branches/mssql_limit_regression/lib/DBIx/Class/SQLAHacks.pm
===================================================================
--- DBIx-Class/0.08/branches/mssql_limit_regression/lib/DBIx/Class/SQLAHacks.pm 2009-12-15 22:19:01 UTC (rev 8119)
+++ DBIx-Class/0.08/branches/mssql_limit_regression/lib/DBIx/Class/SQLAHacks.pm 2009-12-15 23:38:04 UTC (rev 8120)
@@ -59,10 +59,12 @@
# whatever is left
my $group_having = $self->_order_by($order);
- $sql = sprintf (<<'EOS', $order_by, $sql, $group_having, $offset + 1, $offset + $rows, );
+ my $qalias = $self->_quote ($self->{_dbic_rs_attrs}{alias});
+ $sql = sprintf (<<'EOS', $qalias, $order_by, $sql, $group_having, $qalias, $offset + 1, $offset + $rows, );
+
SELECT * FROM (
- SELECT orig_query.*, ROW_NUMBER() OVER(%s ) AS rno__row__index FROM (%s%s) orig_query
+ SELECT %s.*, ROW_NUMBER() OVER(%s ) AS rno__row__index FROM (%s%s) %s
) rno_subq WHERE rno__row__index BETWEEN %d AND %d
EOS
Modified: DBIx-Class/0.08/branches/mssql_limit_regression/t/746mssql.t
===================================================================
--- DBIx-Class/0.08/branches/mssql_limit_regression/t/746mssql.t 2009-12-15 22:19:01 UTC (rev 8119)
+++ DBIx-Class/0.08/branches/mssql_limit_regression/t/746mssql.t 2009-12-15 23:38:04 UTC (rev 8120)
@@ -417,7 +417,7 @@
FROM (
SELECT *
FROM (
- SELECT orig_query.*, ROW_NUMBER() OVER( ORDER BY (SELECT(1)) ) AS rno__row__index
+ SELECT [me].*, ROW_NUMBER() OVER( ORDER BY (SELECT(1)) ) AS rno__row__index
FROM (
SELECT [me].[id], [me].[source], [me].[owner], [me].[title], [me].[price]
FROM (
@@ -427,7 +427,7 @@
WHERE ( ( [owner].[name] != ? AND [source] = ? ) )
ORDER BY [owner].[name] DESC
) [me]
- ) orig_query
+ ) [me]
) rno_subq
WHERE rno__row__index BETWEEN 3 AND 9
) [me]
More information about the Bast-commits
mailing list