John and I have had some off-list discussion.

The problem is ultimately a test error; the code written a decade or more
ago doesn't take into account a database server configuration option
introduced in the last five years or so.

The relevant Informix configuration parameter is TEMPTAB_NOLOG.  If set,
the test that relies on being able to rollback changes in a temporary table
will fail because the configuration parameter removes the ability to
rollback changes in temporary tables.

The test will be updated and a new DBD::Informix released, probably before
Christmas; the build is working OK and is safe to use in production (or as
safe as it ever was).

This comment covers both of John's emails to dbi-users mailing list.



On Tue, Nov 12, 2013 at 2:01 AM, John Beranek <j...@redux.org.uk> wrote:

> 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
>



-- 
Jonathan Leffler <jonathan.leff...@gmail.com>  #include <disclaimer.h>
Guardian of DBD::Informix - v2013.0521 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."

Reply via email to