From: Peter Rabbitson Date: Mon, 31 May 2010 17:45:27 +0000 (+0000) Subject: Fix RT57467, simplify test X-Git-Tag: v0.08122~43 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4282b6f8db080b849df4a9d30c8c79aaaabc7838;p=dbsrgits%2FDBIx-Class.git Fix RT57467, simplify test --- diff --git a/Changes b/Changes index 0ef7352..bd0d6af 100644 --- a/Changes +++ b/Changes @@ -36,6 +36,8 @@ Revision history for DBIx::Class connection_info - Do not recreate the same related object twice during MultiCreate (solves the problem of orphaned IC::FS files) + - Fully qualify xp_msver selector when using DBD::Sybase with + MSSQL (RT#57467) * Misc - Add a warning to load_namespaces if a class in ResultSet/ diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm b/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm index ff9223a..d0eb72b 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm @@ -59,7 +59,7 @@ sub _dbh_rollback { sub _get_server_version { my $self = shift; - my $product_version = $self->_get_dbh->selectrow_hashref('xp_msver ProductVersion'); + my $product_version = $self->_get_dbh->selectrow_hashref('master.dbo.xp_msver ProductVersion'); if ((my $version = $product_version->{Character_Value}) =~ /^(\d+)\./) { return $version; diff --git a/t/74mssql.t b/t/74mssql.t index cec6cb7..c51e9de 100644 --- a/t/74mssql.t +++ b/t/74mssql.t @@ -186,20 +186,12 @@ SQL my $have_rno = $version >= 9 ? 1 : 0; - # Delete version information to force RNO check when rebuilding SQLA - # instance. - no strict 'refs'; - no warnings 'redefine'; - local *{(ref $storage).'::_get_server_version'} = sub { undef }; - - my $server_info = { %{ $storage->_server_info_hash } }; # clone - - delete @$server_info{qw/dbms_version normalized_dbms_version/}; - - local $storage->{_server_info_hash} = $server_info; local $storage->{_sql_maker} = undef; local $storage->{_sql_maker_opts} = undef; + local $storage->{_server_info_hash} = { %{ $storage->_server_info_hash } }; # clone + delete @{$storage->{_server_info_hash}}{qw/dbms_version normalized_dbms_version/}; + $storage->sql_maker; my $rno_detected =