Subject: | Manual Transaction handling seems to be broken |
The sqlite_st_execute function tests whether it should issue a "BEGIN
TRANSACTION" statement on the users behalf. However, the test is based
on the settings of AutoCommit. It does not test if the user is sending
a manual transaction statement such as "BEGIN EXCLUSIVE TRANSACTION".
Sqlite forbids starting two transactions at a time, so the user is
unable to use the exclusive transaction setting. I've included a test
to show this happening.
Subject: | manual_exclusive_lock.t |
#! /usr/bin/perl -w
use DBI();
use DBD::SQLite 1.27;
MAIN: {
my ($test_database_path) = "locking_test.sdb";
my ($dbh) = DBI->connect("dbi:SQLite:$test_database_path", "", "", { 'AutoCommit' => 0, 'RaiseError' => 1, 'PrintError' => 0 });
my ($sql) = "BEGIN EXCLUSIVE TRANSACTION";
my ($sth) = $dbh->prepare($sql);
$sth->execute();
unless (unlink($test_database_path)) {
die("Failed to clean up '$test_database_path':$!");
}
}