Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Upgraded SQLite: "database changed" error

by bsb (Priest)
on Jun 06, 2007 at 01:41 UTC ( #619516=note: print w/replies, xml ) Need Help??

in reply to Upgraded SQLite: "database changed" error

It is indeed an interaction between Ima::DBI's use of prepare_cached and SQLite's changed error. Invalidating the $dbh->{CachedKids} is a passable work-around. I tried and failed to globally turn caching off in Ima::DBI::set_sql, but that probably would have caused performance issues anyway. I'm still not sure exactly which change revealed this problem.

DBD::SQLite seems to be the correct place to address this issue. Does anyone else have an opinion on that matter? Is there a better forum for DBD::SQLite discussions? The only other seems to be RT.
$dbh->{CachedKids} = {}; # after ANALYZE or similar # from the example $dbh->prepare_cached('select "hello" from a'); print Dump $dbh->{CachedKids},"\n"; $dbh->{CachedKids} = {}; $dbh->do("analyze"); my $sth = $dbh->prepare_cached('select "hello" from a'); print "got ", $dbh->selectrow_array($sth), "\n";
A section of the DBI_TRACE from my main application
T <- prepare_cached('SELECT FROM step me WHERE ( me.message = ? ) ' undef ...)= DBIx::ContextualFetch::st=HASH(0x8e09f38) at line + 381 T <- FETCH('Active')= '' at line 1139 T <- FETCH('Taint')= 1 at line 50 <- STORE('Taint' 0)= 1 at line 51 !! ERROR: 1 'database schema has changed(1) at dbdimp.c line 421' +(err#0) <- execute('Removing duplicates')= undef at lin +e 52 ERROR: 1 'database schema has changed(1) at dbdimp.c line 421' +(err#0) <> FETCH('Statement')= 'SELECT FROM step me WHERE ( me.message = ? ) ' ('Statement' from cache) at line 1143 Val::Step can't SELECT FROM step me WHERE ( me.message = ? ) : DBD::SQLite::st execute failed: database schema has changed(1) at db +dimp.c line 421 [for Statement "SELECT FROM step me WHERE ( me.message = ? ) "] at /usr/share/perl5/DBIx/ line 52. at bin/ line 196

Replies are listed 'Best First'.
Re^2: Upgraded SQLite: "database changed" error
by jZed (Prior) on Jun 06, 2007 at 05:48 UTC
    The mailing list is an appropriate place to discuss changes to DBDs and the most likely place other than for DBD authors to see your suggestions. Also, there may be similar issues with other DBDs so posting to the list might pull in some other ideas.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://619516]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2017-04-29 10:27 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (531 votes). Check out past polls.