[Digikam-devel] SQLite broken in git

Francesco Riosa francesco at pnpitalia.it
Thu Sep 8 14:41:57 BST 2011


On 09/08/11 03:56, Francesco Riosa wrote:
> 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

This is false, indeed commit
http://commits.kde.org/digikam/18075f4d6f7779fc867b263e261e4f5857e1012c
does exactly this and solve the problem.

FYI I was running digikam from inside qtcreator but it obviously use 
builded, opposedly to installed digikam runtime, but I'was modifing 
libraries sources which are not loaded from build directory w/o setting 
approbriate variables (yesterday it was late night :P).

>
> 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?

it was late, but this be true, I'll look in it deeper in the future

> 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?

please, accept my apologies for the pushed bugs

- Francesco




More information about the Digikam-devel mailing list