On Wed, 21 Jun 2006 09:24:35 +0200, Ralf Junker wrote:

>>1. SQLiteSpy is able to read and work with database files
>>formatted by versions of Sqlite earlier than 3.3.6 but it also
>>appears to change the database format rather than leave
>>it as it was found.
>>
>>I use php version 5.1.4 including Sqlite version 3.2.8.
>>There is a database format change in later versions of
>>Sqlite that means php is NOT able to read these later
>>versions.

>SQLiteSpy does not normally change the database format, just as SQLite does 
>not. However, starting with SQLite 3.3.0, the file format 
changed slightly. This is no problem until you run the VACUUM command, which I 
suppose you did? VACUUM causes SQLite (and therefore 
SQLiteSpy as well) to rewrite the database and to update it to the latest file 
format. 

>There are two solutions to your problem:

>1. Don't run VACUUM from SQLite 3.3.0 or later ;=)

>2. Issue 

>     PRAGMA legacy_file_format=ON;

>   before running VACUUM. This instructs SQLite to use the 
>   pre 3.3.0 file format and maintain compatability with
>   your 3.2.8 PHP version.

>Btw: The problem applies to all software using SQLite 3.3.0 or later, even to 
>the SQLite command-line application.


It appears that VACUUM is not the only SQL command to cause
this behaviour. I had done a number of INSERT and UPDATE
commands before closing the database and attempting to use
it with PHP. The VACUUM command was not used.

For the moment, my situation is not unique since other users of
PHP will face it too. The pragma legacy_file_format=on
instruction should solve the problem. Any possibility that it could
be set as a configuration parameter for SQLiteSpy to avoid the
need to issue the pragma command each time SQLiteSpy is
used?

I have searched the documentation for this pragma but without
success. Is this a case of "Star Wars : Use the source, Luke?"  :-)



Reply via email to