Subject: | CPANPLUS::Internals::Source::SQLite broken with latest version of DBD::SQLite |
Hello,
While compiling my perls, I decided to give perl-5.11.2 a shot and
stumbled on this bug quite by accident. It seems like DBD::SQLite
doesn't like nested transactions ( not sure when it started ) and it
blows up the logic in Source::SQLite.
Here's what happens with CPANPLUS v0.89_10, DBI v1.609, DBD::SQLite
v1.27, DBIx::Simple v1.32
[ERROR] DBI error: SQL logic error or missing database
cannot start a transaction within a transaction
The above message is repeated tens of times when you try to do this:
cpanp x --update_source
Thanks to the helpful folks on irc ( Alias + Caelum ) we tracked this
down to the AutoCommit parameter. Looking at the source, it's set to 0
in __sqlite_dbh() but you also run a BEGIN in _init_trees() and that's
where the problem begins.
We did some rudimentary testing with AutoCommit=1 and it seems to fix
the problem. However, we did not smoke test it against old DBD::SQLite
or anything else. Hopefully by bringing this to your attention, you can
look at it more closer and see what the proper course of action is.
Here's a dump of DBI_TRACE=1 output:
DBI 1.609-nothread default trace level set to 0x0/1 (pid 14890) at
DBI.pm line 273 via Simple.pm line 3
[MSG] Checking if source files are up to date
[MSG] Updating source file '01mailrc.txt.gz'
[MSG] Trying to get 'ftp://192.168.0.200/CPAN/authors/01mailrc.txt.gz'
[MSG] Updating source file '03modlist.data.gz'
[MSG] Trying to get 'ftp://192.168.0.200/CPAN/modules/03modlist.data.gz'
[MSG] Updating source file '02packages.details.txt.gz'
[MSG] Trying to get
'ftp://192.168.0.200/CPAN/modules/02packages.details.txt.gz'
->
DBI->connect(dbi:SQLite:dbname=/home/cpan/cpanp_conf/perl-5.11.2-default/.cpanplus/db.sql,
, ****, HASH(0x37c2428))
-> DBI->install_driver(SQLite) for linux perl=5.011002 pid=14890
ruid=1001 euid=1001
install_driver: DBD::SQLite version 1.27 loaded from
/home/cpan/perls/perl-5.11.2-default/lib/site_perl/5.11.2/x86_64-linux/DBD/SQLite.pm
<- install_driver= DBI::dr=HASH(0x3a0c330)
!! warn: 0 CLEARED by call to connect method
<-
connect('dbname=/home/cpan/cpanp_conf/perl-5.11.2-default/.cpanplus/db.sql',
'', ...)= ( DBI::db=HASH(0x37c2338) ) [1 items] at DBI.pm line 653
<- STORE('PrintError', 0)= ( 1 ) [1 items] at DBI.pm line 705
<- STORE('AutoCommit', 0)= ( 1 ) [1 items] at DBI.pm line 705
<- STORE('PrintWarn', 0)= ( 1 ) [1 items] at DBI.pm line 708
<- FETCH('PrintWarn')= ( '' ) [1 items] at DBI.pm line 708
<- STORE('Warn', 0)= ( 1 ) [1 items] at DBI.pm line 708
<- FETCH('Warn')= ( '' ) [1 items] at DBI.pm line 708
<- STORE('Username', '')= ( 1 ) [1 items] at DBI.pm line 708
<> FETCH('Username')= ( '' ) [1 items] ('Username' from cache) at
DBI.pm line 708
<-
connected('dbi:SQLite:dbname=/home/cpan/cpanp_conf/perl-5.11.2-default/.cpanplus/db.sql',
'', ...)= ( undef ) [1 items] at DBI.pm line 714
<- connect= DBI::db=HASH(0x37c2338)
<- STORE('dbi_connect_closure', CODE(0x39c9ab0))= ( 1 ) [1 items] at
DBI.pm line 723
<- FETCH('Driver')= ( DBI::dr=HASH(0x3a0c330) ) [1 items] at
Simple.pm line 53
<> FETCH('Name')= ( 'SQLite' ) [1 items] ('Name' from cache) at
Simple.pm line 53
<- prepare('
DROP TABLE IF EXISTS author;
')= ( DBI::st=HASH(0x37c20c8) ) [1 items] at Simple.pm line 141
<- execute= ( '0E0' ) [1 items] at Simple.pm line 160
<- finish= ( 1 ) [1 items] at Simple.pm line 264
<- prepare('
DROP TABLE IF EXISTS module;
')= ( DBI::st=HASH(0x357b180) ) [1 items] at Simple.pm line 141
<- execute= ( '0E0' ) [1 items] at Simple.pm line 160
<- finish= ( 1 ) [1 items] at Simple.pm line 264
<- prepare('
/* the author information */
CREATE TABLE author (
id INTEGER PRIMARY KEY AUTOINCREMENT,
author varchar(255),
email varchar(255),
cpanid varchar(255)
);
')= ( DBI::st=HASH(0x3c037f8) ) [1 items] at Simple.pm line 141
<- execute= ( '0E0' ) [1 items] at Simple.pm line 160
<- finish= ( 1 ) [1 items] at Simple.pm line 264
<- prepare('
/* the module information */
CREATE TABLE module (
id INTEGER PRIMARY KEY AUTOINCREMENT,
module varchar(255),
version varchar(255),
path varchar(255),
comment varchar(255),
author varchar(255),
package varchar(255),
description varchar(255),
dslip varchar(255),
mtime varchar(255)
);
')= ( DBI::st=HASH(0x3c03a08) ) [1 items] at Simple.pm line 141
<- execute= ( '0E0' ) [1 items] at Simple.pm line 160
<- finish= ( 1 ) [1 items] at Simple.pm line 264
<- prepare('BEGIN')= ( DBI::st=HASH(0x3c04068) ) [1 items] at
Simple.pm line 141
!! ERROR: 1 'SQL logic error or missing database
cannot start a transaction within a transaction' (err#2)
<- execute= ( undef ) [1 items] at Simple.pm line 160
<- $DBI::errstr= 'SQL logic error or missing database
cannot start a transaction within a transaction'
[MSG] Rebuilding author tree, this might take a while
--
~Apocalypse