[Bast-commits] r8050 -
DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/Storage/DBI
frew at dev.catalyst.perl.org
frew at dev.catalyst.perl.org
Wed Dec 9 00:24:45 GMT 2009
Author: frew
Date: 2009-12-09 00:24:45 +0000 (Wed, 09 Dec 2009)
New Revision: 8050
Modified:
DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/Storage/DBI/MSSQL.pm
Log:
fix mssql version check so it's lazier
Modified: DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/Storage/DBI/MSSQL.pm
===================================================================
--- DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/Storage/DBI/MSSQL.pm 2009-12-08 23:19:49 UTC (rev 8049)
+++ DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/Storage/DBI/MSSQL.pm 2009-12-09 00:24:45 UTC (rev 8050)
@@ -235,23 +235,27 @@
if ($data->{Character_Value} =~ /^(\d+)\./) {
return $1;
} else {
- $self->throw_exception(q{your MSSQL server doesn't have a version!});
+ $self->throw_exception(q{Your ProductVersion's Character_Value is missing or malformed!});
}
}
-sub _sql_maker_opts {
- my ( $self, $opts ) = @_;
+sub sql_maker {
+ my $self = shift;
- if ( $opts ) {
- $self->{_sql_maker_opts} = { %$opts };
+ unless ($self->_sql_maker) {
+ unless ($self->{_sql_maker_opts}{limit_dialect}) {
+ my $version = $self->_get_mssql_version;
+
+ $self->{_sql_maker_opts} = {
+ limit_dialect => ($version >= 9 ? 'RowNumberOver' : 'Top'),
+ %{$self->{_sql_maker_opts}||{}}
+ };
+ }
+
+ my $maker = $self->next::method (@_);
}
- my $version = $self->_get_mssql_version;
-
- return {
- limit_dialect => ($version >= 9 ? 'RowNumberOver' : 'Top'),
- %{$self->{_sql_maker_opts}||{}}
- };
+ return $self->_sql_maker;
}
1;
More information about the Bast-commits
mailing list