Bug 388275

Summary: UpdateSchemaFromV8ToV9 fails due to duplicate entry for key albumRoot
Product: [Applications] digikam Reporter: Jyrki Soini <Jyrki.Soini>
Component: Database-SchemaAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.8.0   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.8.0
Sentry Crash Report:

Description Jyrki Soini 2017-12-27 16:31:08 UTC
~> digikam-5.8.0-20171227T061903-x86-64.appimage 
-- digiKam AppImage Bundle
-- Use 'help' as CLI argument to know all available options
digikam.widgets: Breeze icons ressource file found
digikam.general: AlbumWatch use QFileSystemWatcher
digikam.general: Database Parameters:
   Type:                     "QMYSQL"
   DB Core Name:             "digikam"
   DB Thumbs Name:           "digikam"
   DB Face Name:             "digikam"
   Connect Options:          "UNIX_SOCKET=/run/mysql/mysql.sock"
   Host Name:                "localhost"
   Host port:                3306
   Internal Server:          false
   Internal Server Path:     ""
   Internal Server Serv Cmd: ""
   Internal Server Init Cmd: ""
   Username:                 "digikam"
   Password:                 "XXXXXXXXXXXXXXXXXXXX"

digikam.dbengine: Loading SQL code from config file "/tmp/.mount_9NjFtj/usr/share/digikam/database/dbconfig.xml"
digikam.dbengine: Checking XML version ID => expected:  3  found:  3
digikam.coredb: Core database: running schema update
digikam.coredb: Core database: have a structure version  8
digikam.coredb: Core database: makeUpdates  8  to  9
digikam.dbengine: Failure executing query:
 "" 
Error messages: "QMYSQL: Unable to execute query" "Duplicate entry '1-/haat' for key 'albumRoot'" 1062 2 
Bound values:  ()
digikam.dbengine: Error while executing DBAction [ "UpdateSchemaFromV8ToV9" ] Statement [ "ALTER TABLE Albums CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;" ]
digikam.coredb: Core database: schema update to V 9 failed!
digikam.coredb: Core database: cannot process schema initialization
KMemoryInfo: Platform identified :  "LINUX"
KMemoryInfo: TotalRam:  16765005824
digikam.general: Allowing a cache size of 200 MB
QThreadStorage: Thread 0x7fcd15013600 exited after QThreadStorage 11 destroyed
Comment 1 Maik Qualmann 2017-12-27 18:21:36 UTC
Git commit f95876db1e132f95fc6a72674b98cc818e4a5d09 by Maik Qualmann.
Committed on 27/12/2017 at 18:20.
Pushed by mqualmann into branch 'master'.

change update procedure for converting MySQL database from v8 to v9
FIXED-IN: 5.8.0

M  +2    -1    NEWS
M  +36   -19   data/database/dbconfig.xml.cmake.in

https://commits.kde.org/digikam/f95876db1e132f95fc6a72674b98cc818e4a5d09