[Digikam-devel] SQLite broken in git

Francesco Riosa francesco at pnpitalia.it
Thu Sep 8 02:56:10 BST 2011


On 09/07/11 12:46, Marcel Wiesweg wrote:
>
>> Hem, then I need to change the logic, at this moment it's teorically
>> possible to have separate engines for images and thumbnails, for example
>> a centralized mysql database for images and a local sqlite database for
>> thumbnails.
>
> I understand, that makes sense
>
>>
>> If avoiding conversion is paramount then we should revert, discuss the
>> wanted logic and then I can adapt it, so what re your suggestions?
>
> I guess it's probably one bug: With SQLite, we store the path but not the filename, because the filename is constant. There has always been code which adds the filename if only a directory is specified. I believe this must be broken at some place (but I'm at work currently, cannot have a look at the code)
>

It's confirmed by the fact that adding the file name to the config file 
make digikam start without issues

[Database Settings]
Database Connectoptions=
Database Hostname=
Database Name=/media/fotos/digikam4.db
Database Name Thumbnails=/media/fotos/thumbnails-digikam.db
Database Password=
Database Port=-1
Database Type=QSQLITE
Database Username=

Also, while initializing configs and databases there are multiple 
threads running.

there is a problem, adding the file names in 
DatabaseParameters::legacyAndDefaultChecks does NOT work, I'm unable to 
understand why ATM

While I've introduced the bug, the fact databases are checked while they 
are accessed don't look a good thing is it possible to put config 
reading and database check/initialization in a single thread? Would it 
have a startup time penalty?

BTW what was the rationale behind storing the directory and not a plain 
file path/name? there where already two names one for images the other 
for thumbnails.
Could be possible to convert to use only file names? The logic for 
migration would be:
is it a SQLITE database?
   the path point to a directory?
     yes, add the canonical file name and be done with it
     no, it's already a full path

I'm using qtcreator to follow the code while it's executed, and I'm 
unable to get to the point, do you know something better?



More information about the Digikam-devel mailing list