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)
+ - Fix ::DBI::Storage to always be able to present a full set of
+ connect() attributes to e.g. Schema::Versioned
* Misc
- Add a warning to load_namespaces if a class in ResultSet/
{
my ($self) = @_;
- my $info = $self->storage->connect_info;
- my $args = $info->[-1];
+ my $conn_info = $self->storage->connect_info;
+ $self->{vschema} = DBIx::Class::Version->connect(@$conn_info);
+ my $conn_attrs = $self->{vschema}->storage->_dbic_connect_attributes || {};
- $self->{vschema} = DBIx::Class::Version->connect(@$info);
my $vtable = $self->{vschema}->resultset('Table');
# useful when connecting from scripts etc
- return if ($args->{ignore_version} || ($ENV{DBIC_NO_VERSION_CHECK} && !exists $args->{ignore_version}));
+ return if ($conn_attrs->{ignore_version} || ($ENV{DBIC_NO_VERSION_CHECK} && !exists $conn_attrs->{ignore_version}));
# check for legacy versions table and move to new if exists
- my $vschema_compat = DBIx::Class::VersionCompat->connect(@$info);
+ my $vschema_compat = DBIx::Class::VersionCompat->connect(@$conn_info);
unless ($self->_source_exists($vtable)) {
my $vtable_compat = $vschema_compat->resultset('TableCompat');
if ($self->_source_exists($vtable_compat)) {
$self->{vschema}->deploy;
map { $vtable->create({ installed => $_->Installed, version => $_->Version }) } $vtable_compat->all;
- $self->storage->dbh->do("DROP TABLE " . $vtable_compat->result_source->from);
+ $self->storage->_get_dbh->do("DROP TABLE " . $vtable_compat->result_source->from);
}
}
use File::Path ();
use namespace::clean;
-__PACKAGE__->mk_group_accessors('simple' =>
- qw/_connect_info _dbi_connect_info _dbh _sql_maker _sql_maker_opts _conn_pid
- _conn_tid transaction_depth _dbh_autocommit _driver_determined savepoints
- _server_info_hash/
-);
+__PACKAGE__->mk_group_accessors('simple' => qw/
+ _connect_info _dbi_connect_info _dbic_connect_attributes _driver_determined
+ _dbh _server_info_hash _conn_pid _conn_tid _sql_maker _sql_maker_opts
+ transaction_depth _dbh_autocommit savepoints
+/);
# the values for these accessors are picked out (and deleted) from
# the attribute hashref passed to connect_info
$self->_dbi_connect_info([@args,
%attrs && !(ref $args[0] eq 'CODE') ? \%attrs : ()]);
+ # FIXME - dirty:
+ # save attributes them in a separate accessor so they are always
+ # introspectable, even in case of a CODE $dbhmaker
+ $self->_dbic_connect_attributes (\%attrs);
+
return $self->_connect_info;
}
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;
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 =