$schema = DBICTest::Schema->clone;
- if ($storage_idx != 0) { # autodetect
- $schema->storage_type("::$storage_type");
- }
-
$schema->connection($dsn, $user, $pass);
- $schema->storage->ensure_connected;
+ if ($storage_idx != 0) { # autodetect
+ no warnings 'redefine';
+ local *DBIx::Class::Storage::DBI::_typeless_placeholders_supported =
+ sub { 0 };
+# $schema->storage_type("::$storage_type");
+ $schema->storage->ensure_connected;
+ }
+ else {
+ $schema->storage->ensure_connected;
+ }
if ($storage_idx == 0 && ref($schema->storage) =~ /NoBindVars\z/) {
my $tb = Test::More->builder;
isa_ok($schema->storage, "DBIx::Class::Storage::$storage_type");
-# start disconnected to test reconnection
+# start disconnected to test _ping
$schema->storage->_dbh->disconnect;
- my $dbh;
- lives_ok (sub {
- $dbh = $schema->storage->dbh;
- }, 'reconnect works');
+ lives_ok {
+ $schema->storage->dbh_do(sub { $_[1]->do('select 1') })
+ } '_ping works';
+
+ my $dbh = $schema->storage->dbh;
$dbh->do("IF OBJECT_ID('artist', 'U') IS NOT NULL
DROP TABLE artist");