11 my $schema = DBICTest->init_schema;
16 $schema->resultset('CD')->create({ title => 'vacation in antarctica' })
18 qr/DBI Exception.+(?x:
19 \QNOT NULL constraint failed: cd.artist\E
21 \Qcd.artist may not be NULL\E
23 ); # as opposed to some other error
24 }, [], 'No warnings besides exception' );
26 my $dbh = $schema->storage->dbh;
30 $dbh->do ('INSERT INTO nonexistent_table VALUES (1)')
32 qr/DBI Exception.+no such table.+nonexistent_table/s,
33 'DBI exceptions properly handled by dbic-installed callback'
36 # This usage is a bit unusual but it was actually seen in the wild
37 # destruction of everything except the $dbh should use the proper
41 if ( !!DBIx::Class::_ENV_::PEEPEENESS ) {
42 skip "Your perl version $] appears to leak like a sieve - skipping garbage collected \$schema test", 1;
48 $dbh->do ('INSERT INTO nonexistent_table VALUES (1)')
50 qr/DBI Exception.+unhandled by DBIC.+no such table.+nonexistent_table/s,
51 'callback works after $schema is gone'