From 583abd817e5b155f27d733d04919404ed2842758 Mon Sep 17 00:00:00 2001 From: Kenichi Ishigaki Date: Tue, 7 Apr 2009 17:17:19 +0000 Subject: [PATCH] DBD-SQLite: added a test; execute on inactive error should return undef, not 0 --- t/32_inactive_error.t | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 t/32_inactive_error.t diff --git a/t/32_inactive_error.t b/t/32_inactive_error.t new file mode 100644 index 0000000..311aa41 --- /dev/null +++ b/t/32_inactive_error.t @@ -0,0 +1,20 @@ +#!/usr/bin/perl + +use strict; +BEGIN { + $| = 1; + $^W = 1; +} + +use Test::More tests => 2; +use t::lib::Test; + +my $dbh = connect_ok( PrintError => 0, RaiseError => 1 ); + +my $sth = $dbh->prepare('CREATE TABLE foo (f)'); + $dbh->disconnect; + +# attempt to execute on inactive database handle +my $ret = eval { $sth->execute; }; + +ok !defined $ret;