[Digikam-devel] [Bug 277242] After SQLite --> MySQL conversion, digikam reports error regarding DBThumbnailsVersion on start up.

Francesco Riosa francesco+kde at pnpitalia.it
Sun Jul 10 21:45:40 BST 2011


https://bugs.kde.org/show_bug.cgi?id=277242


Francesco Riosa <francesco+kde at pnpitalia.it> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |francesco+kde at pnpitalia.it




--- Comment #5 from Francesco Riosa <francesco+kde pnpitalia it>  2011-07-10 20:45:39 ---
(In reply to comment #3)
> I think I can explain a bit of it, and how to make it work the temporary
> way:
> 
> If you have a separate Mysql DB for thumbs (say 'digikam' for images and
> 'digikam_thumbs' for the thumbnails), then a 'settings' table is written
> into 'digikam_thumbs'. During the migration from sqlite, nothing gets
> written into into that table, although the sqlite corresponding table has
> DBThumbnailsVersionRequired:1, DBThumbnailsVersion:2 in it.
> 
> I added the two records to 'digikam_thumbs'.settings, but digikam still
> throws the same error. Then I added the 2 records to  'digikam'.settings and
> it worked, no error message anymore, and digikam finds all its thumbnails
> from the DB again.
> 
> 
> Gerhard

I'll test using separate databases for images and thumbnails, in the meantime
could you explain the rationale for using different databases in mysql for
tables and thumbs?

Because I was thinking on this the last week and made no sense to me, either it
should be possible to have different types of databases i.e. images on mysql
and thumbs on sqlite, or it should be all in one database, so I'm curious of
this one



(In reply to comment #4)
> I also did some testing and i will describe my findings in brief here in hopes
> someone who is more familiar with the database code will understand the
> problem.
> 
> Consider the line of code in core/libs/database/thumbnailschemaupdater.cpp:92
> 
>     QStringList tables = m_access->backend()->tables();    

this call
- QStringList QSqlDatabase::tables ( QSql::TableType type = QSql::Tables )
const
- Returns a list of the database's tables, system tables and views, as
specified by the - parameter type.
if it return tables of other mysql databases it's a QT bug

> 
> If one looks at the list returned, it is in fact a list of tables; however it
> is a list of ALL tables in ALL databases that the particular mysql user can
> read. So in that list there is a 'Settings' table for the 'digikam' database,
> as well as a 'Settings' table for the 'digikam_thumbs' database. When the code
> asks for the 'Settings' table (which i am assuming line 97 of the same file
> does) is ambiguous, and probably returns the first Settings table that occurs
> alphabetically; in the example above that would be 'digikam.settings' rather
> than 'digikam_thumbs.settings'.
> 
> This explains the behavior in the above comment. I am still sifting through the
> code to figure out why there is no database specified in this particular
> database code. I am not familiar with this code; so perhaps someone familiar
> with the code will find a fix first. 
>

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list