X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F71mysql.t;h=18a44b03ec3b2ecc2d4f552d7687e06aca737207;hb=f98120e4b249787a84b7d19819d9bda9e53d3711;hp=d75474e8361454f63e1425722343ca7ce87b7f25;hpb=1db83fb9ce3e15d68e2384720ed06af6de5edbac;p=dbsrgits%2FDBIx-Class.git diff --git a/t/71mysql.t b/t/71mysql.t index d75474e..18a44b0 100644 --- a/t/71mysql.t +++ b/t/71mysql.t @@ -344,13 +344,21 @@ ZEROINSEARCH: { ); } -## If find() is the first query after connect() -## DBI::Storage::sql_maker() will be called before -## _determine_driver() and so the ::SQLHacks class for MySQL -## will not be used - -my $schema2 = DBICTest::Schema->connect($dsn, $user, $pass); -$schema2->resultset("Artist")->find(4); -isa_ok($schema2->storage->sql_maker, 'DBIx::Class::SQLMaker::MySQL'); +# make sure find hooks determine driver +{ + my $schema = DBICTest::Schema->connect($dsn, $user, $pass); + $schema->resultset("Artist")->find(4); + isa_ok($schema->storage->sql_maker, 'DBIx::Class::SQLMaker::MySQL'); +} + +# make sure the mysql_auto_reconnect buggery is avoided +{ + local $ENV{MOD_PERL} = 'boogiewoogie'; + my $schema = DBICTest::Schema->connect($dsn, $user, $pass); + ok (! $schema->storage->_get_dbh->{mysql_auto_reconnect}, 'mysql_auto_reconnect unset regardless of ENV' ); + + my $schema2 = DBICTest::Schema->connect($dsn, $user, $pass, { mysql_auto_reconnect => 1 }); + ok ($schema2->storage->_get_dbh->{mysql_auto_reconnect}, 'but is properly set if explicitly requested mysql_auto_reconnect' ); +} done_testing;