On 12/11/2013 08:59, John Beranek wrote:
I'm trying to compile DBD::Informix on a Linux server (or alternatively
on a Solaris 10 server, but this shows the same problems) but I'm
getting failures in the test suite.
Firstly, I've fixed the subject, that is the subject I had initially
intended to use.
I boiled down the tests into a simple test script, to convince myself of
the results:
use DBI;
my $database = 'testdb';
my $username = 'informix';
my $password = 'somepassword';
my $test_table = 'test_jb';
my $dbh = DBI->connect("dbi:Informix:$database", $username, $password,
{AutoCommit => 0});
$dbh->do("CREATE TEMP TABLE $test_table
(
Col01 SERIAL NOT NULL PRIMARY KEY,
Col02 CHAR(20) NOT NULL,
Col03 DATE NOT NULL,
Col04 DATETIME YEAR TO FRACTION(5) NOT NULL
)") or die "CREATE TEMP TABLE failed\n";
$dbh->commit();
my $date = '25/12/1996';
my $time = '2004-02-29 23:59:54.32109';
$dbh->do("INSERT INTO $test_table VALUES(0, 'data', '$date', '$time')");
$dbh->rollback();
my $sth = $dbh->prepare("SELECT * from $test_table");
$sth->execute();
use Data::Dumper;
print Dumper($sth->fetchall_arrayref);
$dbh->disconnect();
The results of this script are:
$VAR1 = [
[
'1',
'data ',
'25/12/1996',
'2004-02-29 23:59:54.32109'
]
];
i.e. the "rollback" appears not to have worked. From the output of the
test suite, the database is a logged database, and there doesn't appear
to be any errors setting autocommit off. So, what would cause
transaction rollbacks not to work?
Cheers,
John
--
John Beranek To generalise is to be an idiot.
http://redux.org.uk/ -- William Blake