1 package # hide from PAUSE
5 use base qw(DBIx::Class::CDBICompat);
12 if (! $ENV{DBICTEST_MYSQL_DSN} ) {
13 $err = 'Set $ENV{DBICTEST_MYSQL_DSN}, _USER and _PASS to run this test';
15 elsif ( ! DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_mysql') ) {
16 $err = 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_mysql')
20 my $t = eval { Test::Builder->new };
21 if ($t and ! $t->current_test) {
29 my @connect = (@ENV{map { "DBICTEST_MYSQL_${_}" } qw/DSN USER PASS/}, { PrintError => 0});
30 $dbh = DBI->connect(@connect) or die DBI->errstr;
33 END { $dbh->do("DROP TABLE $_") foreach @table }
35 __PACKAGE__->connection(@connect);
39 $class->table($class->create_test_table);
42 sub create_test_table {
44 my $table = $self->next_available_table;
45 my $create = sprintf "CREATE TABLE $table ( %s )", $self->create_sql;
51 sub next_available_table {
54 $dbh->selectcol_arrayref(
60 my $table = $tables[-1] || "aaa";