Blame t/rt_48393_debug_panic_with_commit.t

Packit 723767
#!/usr/bin/perl
Packit 723767
Packit 723767
use strict;
Packit 723767
BEGIN {
Packit 723767
	$|  = 1;
Packit 723767
	$^W = 1;
Packit 723767
}
Packit 723767
Packit 723767
use lib "t/lib";
Packit 723767
use SQLiteTest;
Packit 723767
use Test::More;
Packit 723767
Packit 723767
BEGIN {
Packit 723767
	plan skip_all =>
Packit 723767
		'set $ENV{TEST_DBD_SQLITE_WITH_DEBUGGER} '.
Packit 723767
		'to enable this test'
Packit 723767
		unless $ENV{TEST_DBD_SQLITE_WITH_DEBUGGER};
Packit 723767
}
Packit 723767
Packit 723767
use Test::NoWarnings;
Packit 723767
Packit 723767
plan tests => 2;
Packit 723767
Packit 723767
my $file = 't/panic.pl';
Packit 723767
open my $fh, '>', $file;
Packit 723767
print $fh <DATA>;
Packit 723767
close $fh;
Packit 723767
Packit 723767
if ($^O eq 'MSWin32') {
Packit 723767
	ok !system(qq{set PERLDB_OPTS="NonStop"; $^X -Mblib -d $file});
Packit 723767
}
Packit 723767
else {
Packit 723767
	ok !system(qq{PERLDB_OPTS="NonStop" $^X -Mblib -d $file});
Packit 723767
}
Packit 723767
Packit 723767
END {
Packit 723767
	unlink $file if $file && -f $file;
Packit 723767
	unlink 'test.db' if -f 'test.db';
Packit 723767
}
Packit 723767
Packit 723767
__DATA__
Packit 723767
use strict;
Packit 723767
use warnings;
Packit 723767
use DBI;
Packit 723767
Packit 723767
my $db_file = 'test.db';
Packit 723767
Packit 723767
unlink($db_file);
Packit 723767
die "Could not delete $db_file - $!" if(-e $db_file);
Packit 723767
Packit 723767
my $dbh = DBI->connect("dbi:SQLite:dbname=$db_file", undef, undef, {
Packit 723767
RaiseError => 1, AutoCommit => 1 });
Packit 723767
Packit 723767
$dbh->do('CREATE TABLE t1 (id int)');
Packit 723767
Packit 723767
$dbh->begin_work or die $dbh->errstr;
Packit 723767
Packit 723767
my $sth = $dbh->prepare('INSERT INTO t1 (id) VALUES (1)');
Packit 723767
$sth->execute;
Packit 723767
Packit 723767
# XXX: Panic occurs here when running under the debugger
Packit 723767
$dbh->commit or die $dbh->errstr;
Packit 723767