X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F71mysql.t;h=0d49a0e151d524f44882277ab1a367be58018134;hb=bac6c4fb44d23391b40e5fcf53809c0ca0c75dc7;hp=c9e03afacef11e9f9cfee77e9c5ab99a2360b2ff;hpb=de5f71ef956cfad4e7339022a63480068b68d16c;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/71mysql.t b/t/71mysql.t index c9e03af..0d49a0e 100644 --- a/t/71mysql.t +++ b/t/71mysql.t @@ -45,6 +45,14 @@ $dbh->do("CREATE TABLE books (id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, so #'dbi:mysql:host=localhost;database=dbic_test', 'dbic_test', ''); +# make sure sqlt_type overrides work (::Storage::DBI::mysql does this) +{ + my $schema = DBICTest::Schema->connect($dsn, $user, $pass); + + ok (!$schema->storage->_dbh, 'definitely not connected'); + is ($schema->storage->sqlt_type, 'MySQL', 'sqlt_type correct pre-connection'); +} + # This is in Core now, but it's here just to test that it doesn't break $schema->class('Artist')->load_components('PK::Auto'); @@ -219,4 +227,14 @@ NULLINSEARCH: { => 'Nothing Found!'; } + +## 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::SQLAHacks::MySQL'); + done_testing;