Fix multiple savepointing transactions on DBD::SQLite
authorPeter Rabbitson <ribasushi@cpan.org>
Tue, 27 May 2014 11:15:45 +0000 (13:15 +0200)
committerPeter Rabbitson <ribasushi@cpan.org>
Tue, 27 May 2014 17:22:43 +0000 (19:22 +0200)
commit398215b170197df314fb0c40e0654c3a6860f19d
treef8c49e5c7fb3d0ef29bce683abd66e5d00f7312f
parent56270bba4fb06051ea5262d99f858920c796562e
Fix multiple savepointing transactions on DBD::SQLite

Problem was missed during review of 86a51471ce (how the fuck did I let this
abomination through anyway), and not encountered due to insufficient testing.
The naive statement parser in DBD::SQLite when running against older libsqlite
mistakenly treats ROLLBACK TRANSACTION TO... as an actual TXN rollback, and
as a result desyncs the internal AutoCommit flag state [1]
Fix by simply using the shorter (still valid) syntax [2], and by removing the
sloppy workaround hiding the actual problem.

[1] https://github.com/DBD-SQLite/DBD-SQLite/blob/1.42/dbdimp.c#L824:L852
[2] http://www.sqlite.org/lang_savepoint.html
Changes
lib/DBIx/Class/Storage.pm
lib/DBIx/Class/Storage/DBI/SQLite.pm
t/752sqlite.t