[Digikam-devel] [Bug 271924] New: digikam fail to create/update mysql database on startup [PATCH]

Francesco Riosa francesco at pnpitalia.it
Thu Apr 28 14:34:35 BST 2011


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

           Summary: digikam fail to create/update mysql database on
                    startup [PATCH]
           Product: digikam
           Version: 2.0.0
          Platform: Compiled Sources
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: Database
        AssignedTo: digikam-devel at kde.org
        ReportedBy: francesco at pnpitalia.it


Created an attachment (id=59392)
 --> (http://bugs.kde.org/attachment.cgi?id=59392)
easy-digikam-dbupdate.patch resilient db update

Version:           2.0.0 (using KDE 4.6.2) 
OS:                Linux

since some time digikam tell me "Failed to create tables in database."
then it start with empty albums. Going into setup and telling it to add a new
root album make it work but with outdated database schema.

The database is stored into a system mysql install, with user "digikam" which
have full privilege on database "digikam".

the problem possibly is generated initially by a broken update, not sure of it.

The query are not executed because elements of the update are already in place,
making the transaction fail altoghether.

my solution is to make update more resilient (even if redundant) to already in
place tables/indexes/triggers.

attached patch for dbconfig.xml.cmake does:
- add a new stored procedure `create_index_if_not_exists` which is able to
create conditionally indexes on mysql 5.1+ (unsure about 5.0)
- move all "CREATE TABLE" to "CREATE TABLE IF NOT EXISTS"
- drop triggers and recreate them


Reproducible: Always

Steps to Reproduce:
start digikam

Actual Results:  
no more photo

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