[Bast-commits] r9289 -
DBIx-Class/0.08/branches/subqueried_limit_fixes/lib/DBIx/Class/Storage/DBI
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Mon May 3 16:32:35 GMT 2010
Author: ribasushi
Date: 2010-05-03 17:32:35 +0100 (Mon, 03 May 2010)
New Revision: 9289
Modified:
DBIx-Class/0.08/branches/subqueried_limit_fixes/lib/DBIx/Class/Storage/DBI/MSSQL.pm
Log:
Do not add TOP prefixes to queries already containing it
Modified: DBIx-Class/0.08/branches/subqueried_limit_fixes/lib/DBIx/Class/Storage/DBI/MSSQL.pm
===================================================================
--- DBIx-Class/0.08/branches/subqueried_limit_fixes/lib/DBIx/Class/Storage/DBI/MSSQL.pm 2010-05-03 16:31:19 UTC (rev 9288)
+++ DBIx-Class/0.08/branches/subqueried_limit_fixes/lib/DBIx/Class/Storage/DBI/MSSQL.pm 2010-05-03 16:32:35 UTC (rev 9289)
@@ -158,7 +158,11 @@
# see if this is an ordered subquery
my $attrs = $_[3];
- if ( scalar $self->_parse_order_by ($attrs->{order_by}) ) {
+ if (
+ $sql !~ /^ \s* SELECT \s+ TOP \s+ \d+ \s+ /xi
+ &&
+ scalar $self->_parse_order_by ($attrs->{order_by})
+ ) {
$self->throw_exception(
'An ordered subselect encountered - this is not safe! Please see "Ordered Subselects" in DBIx::Class::Storage::DBI::MSSQL
') unless $attrs->{unsafe_subselect_ok};
More information about the Bast-commits
mailing list