Summary: | UpdateSchemaFromV7ToV9 fails | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Jyrki Soini <Jyrki.Soini> |
Component: | Database-Schema | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles, metzpinguin |
Priority: | NOR | ||
Version First Reported In: | 5.8.0 | ||
Target Milestone: | --- | ||
Platform: | Appimage | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 6.1.0 | |
Sentry Crash Report: |
Description
Jyrki Soini
2018-01-04 17:11:08 UTC
*** This bug has been marked as a duplicate of bug 388501 *** Ok, a little further. So we can not add CONSTRAINT if duplicate data already exists. I see no other solution than to search for duplicate data and delete it beforehand. Maik UpdateSchemaFromV7ToV9 still fails in digikam-5.8.0-20180106T073314-x86-64.appimage ~> digikam-5.8.0-20180106T073314-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_digikavZSpSc/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" "Cannot add or update a child row: a foreign key constraint fails (`digikam`.`#sql-83e_13`, CONSTRAINT `Images_Albums` FOREIGN KEY (`album`) REFERENCES `Albums` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)" 1452 2 Bound values: () digikam.dbengine: Error while executing DBAction [ "UpdateSchemaFromV7ToV9" ] Statement [ "ALTER IGNORE TABLE Images\n ADD CONSTRAINT Images_Albums FOREIGN KEY (album) REFERENCES Albums (id) ON DELETE CASCADE ON UPDATE CASCADE,\n ADD UNIQUE (album, name(255)),\n ENGINE InnoDB;" ] digikam.coredb: Core database: schema update to V 9 failed! digikam.coredb: Core database: cannot process schema initialization KMemoryInfo: Platform identified : "LINUX" KMemoryInfo: TotalRam: 16765001728 digikam.general: Allowing a cache size of 200 MB QThreadStorage: Thread 0x7f531dff3c80 exited after QThreadStorage 11 destroyed I have recreated this error (wrong foreign key constraint), but with MarioDB there are no problems. We set FOREIGN_KEY_CHECKS=0, that should work. I will see if I can find MySQL packages for my distribution. Maik The errors I reported are against MariaDB 10.2.11. ~> digikam-5.8.0-20180107T063018-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_digikaz3rtS4/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" "Cannot add or update a child row: a foreign key constraint fails (`digikam`.`#sql-7609_b`, CONSTRAINT `Images_Albums` FOREIGN KEY (`album`) REFERENCES `Albums` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)" 1452 2 Bound values: () digikam.dbengine: Error while executing DBAction [ "UpdateSchemaFromV7ToV9" ] Statement [ "ALTER IGNORE TABLE Images\n ADD CONSTRAINT Images_Albums FOREIGN KEY (album) REFERENCES Albums (id) ON DELETE CASCADE ON UPDATE CASCADE,\n ADD UNIQUE (album, name(255)),\n ENGINE InnoDB;" ] digikam.coredb: Core database: schema update to V 9 failed! digikam.coredb: Core database: cannot process schema initialization KMemoryInfo: Platform identified : "LINUX" KMemoryInfo: TotalRam: 16765001728 digikam.general: Allowing a cache size of 200 MB QThreadStorage: Thread 0x7f9e2a0f1c80 exited after QThreadStorage 11 destroyed Problem still reproducible with AppImage bundle 6.0.0-beta1 available here : https://files.kde.org/digikam/ Gilles Caulier Not reproducible with last 6.1.0 pre-release AppImage bundle : https://files.kde.org/digikam/ Gilles Caulier |