[Bast-commits] r8042 - in
DBIx-Class/0.08/branches/mssql_rno_pagination: .
lib/DBIx/Class lib/DBIx/Class/SQLAHacks
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sat Dec 5 10:44:25 GMT 2009
Author: ribasushi
Date: 2009-12-05 10:44:25 +0000 (Sat, 05 Dec 2009)
New Revision: 8042
Added:
DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/SQLAHacks/MSSQL.pm
Modified:
DBIx-Class/0.08/branches/mssql_rno_pagination/Makefile.PL
DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/SQLAHacks.pm
Log:
DB2 and MSSQL have different default order syntaxes
Modified: DBIx-Class/0.08/branches/mssql_rno_pagination/Makefile.PL
===================================================================
--- DBIx-Class/0.08/branches/mssql_rno_pagination/Makefile.PL 2009-12-05 10:03:00 UTC (rev 8041)
+++ DBIx-Class/0.08/branches/mssql_rno_pagination/Makefile.PL 2009-12-05 10:44:25 UTC (rev 8042)
@@ -144,6 +144,7 @@
no_index 'DBIx::Class::SQLAHacks';
no_index 'DBIx::Class::SQLAHacks::MySQL';
+no_index 'DBIx::Class::SQLAHacks::MSSQL';
no_index 'DBIx::Class::SQLAHacks::OracleJoins';
no_index 'DBIx::Class::Storage::DBI::AmbiguousGlob';
no_index 'DBIx::Class::Storage::DBIHacks';
Added: DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/SQLAHacks/MSSQL.pm
===================================================================
--- DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/SQLAHacks/MSSQL.pm (rev 0)
+++ DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/SQLAHacks/MSSQL.pm 2009-12-05 10:44:25 UTC (rev 8042)
@@ -0,0 +1,14 @@
+package # Hide from PAUSE
+ DBIx::Class::SQLAHacks::MSSQL;
+
+use base qw( DBIx::Class::SQLAHacks );
+use Carp::Clan qw/^DBIx::Class|^SQL::Abstract/;
+
+#
+# MSSQL does not support ... OVER() ... RNO limits
+#
+sub _rno_default_order {
+ return \ '(SELECT(1))';
+}
+
+1;
Modified: DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/SQLAHacks.pm
===================================================================
--- DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/SQLAHacks.pm 2009-12-05 10:03:00 UTC (rev 8041)
+++ DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/SQLAHacks.pm 2009-12-05 10:44:25 UTC (rev 8042)
@@ -53,7 +53,7 @@
# get the order_by only (or make up an order if none exists)
my $order_by = $self->_order_by(
- (delete $order->{order_by}) || \ '(SELECT (1))'
+ (delete $order->{order_by}) || $self->_rno_default_order
);
# whatever is left
@@ -71,6 +71,11 @@
return $sql;
}
+# some databases are happy with OVER (), some need OVER (ORDER BY (SELECT (1)) )
+sub _rno_default_order {
+ return undef;
+}
+
# Crappy Top based Limit/Offset support. Legacy from MSSQL.
sub _Top {
my ( $self, $sql, $order, $rows, $offset ) = @_;
More information about the Bast-commits
mailing list