fail nicely if user doesn't have perms for xp_msver
Arthur Axel "fREW" Schmidt [Wed, 9 Dec 2009 23:32:55 +0000 (23:32 +0000)]
lib/DBIx/Class/Storage/DBI/MSSQL.pm

index dec843f..cc831e8 100644 (file)
@@ -244,7 +244,7 @@ sub sql_maker {
 
   unless ($self->_sql_maker) {
     unless ($self->{_sql_maker_opts}{limit_dialect}) {
-      my $version = $self->_get_mssql_version;
+      my $version = eval { $self->_get_mssql_version; } || 0;
 
       $self->{_sql_maker_opts} = {
         limit_dialect => ($version >= 9 ? 'RowNumberOver' : 'Top'),