1 package # hide from PAUSE
12 use base qw(DBIx::Class::CDBICompat);
17 if (! $ENV{DBICTEST_MYSQL_DSN} ) {
18 $err = 'Set $ENV{DBICTEST_MYSQL_DSN}, _USER and _PASS to run this test';
20 elsif ( ! DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_mysql') ) {
21 $err = 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_mysql')
25 my $t = eval { Test::Builder->new };
26 if ($t and ! $t->current_test) {
34 my @connect = (@ENV{map { "DBICTEST_MYSQL_${_}" } qw/DSN USER PASS/}, { PrintError => 0});
35 # this is only so we grab a lock on mysql
37 my $x = DBICTest::Schema->connect(@connect);
40 $dbh = DBI->connect(@connect) or die DBI->errstr;
43 END { $dbh->do("DROP TABLE $_") foreach @table }
45 __PACKAGE__->connection(@connect);
49 $class->table($class->create_test_table);
52 sub create_test_table {
54 my $table = $self->next_available_table;
55 my $create = sprintf "CREATE TABLE $table ( %s )", $self->create_sql;
61 sub next_available_table {
64 $dbh->selectcol_arrayref(
70 my $table = $tables[-1] || "aaa";