[Bast-commits] r9542 - in DBIx-Class/0.08/trunk/lib/DBIx/Class: .
Storage Storage/DBI
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Wed Jun 2 09:55:48 GMT 2010
Author: ribasushi
Date: 2010-06-02 10:55:48 +0100 (Wed, 02 Jun 2010)
New Revision: 9542
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/MSSQL.pm
Log:
Do not use 2**32 directly - causes %u differences between 32 and 64bit
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks.pm 2010-06-02 09:53:12 UTC (rev 9541)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks.pm 2010-06-02 09:55:48 UTC (rev 9542)
@@ -33,7 +33,10 @@
}
}
+# the "oh noes offset/top without limit" constant
+sub __max_int { 0xFFFFFFFF };
+
# Tries to determine limit dialect.
#
sub new {
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/MSSQL.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/MSSQL.pm 2010-06-02 09:53:12 UTC (rev 9541)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/MSSQL.pm 2010-06-02 09:55:48 UTC (rev 9542)
@@ -162,7 +162,7 @@
$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};
- my $max = 2 ** 32;
+ my $max = $self->sql_maker->__max_int;
$sql =~ s/^ \s* SELECT \s/SELECT TOP $max /xi;
}
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2010-06-02 09:53:12 UTC (rev 9541)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2010-06-02 09:55:48 UTC (rev 9542)
@@ -1937,7 +1937,7 @@
}
elsif (defined $attrs->{offset}) {
# MySQL actually recommends this approach. I cringe.
- $attrs->{rows} = 2**32;
+ $attrs->{rows} = $sql_maker->__max_int;
}
my @limit;
More information about the Bast-commits
mailing list