Summary: | Schema update to V6 failed | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | serge |
Component: | Database-Schema | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | caulier.gilles, vivo75+kde |
Priority: | NOR | ||
Version: | 2.4.0 | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 7.0.0 | |
Sentry Crash Report: | |||
Attachments: |
Database structure
MYSQL server log (running digikam after executing SQL code from comment #3) |
Description
serge
2011-12-09 21:08:00 UTC
need more info to try to understand the problem: 1) is the database populated? (if yes please backup) 2) do a mysqldump --no-data of the database, will be needed to know the structure of the database. 3) if you leave digikam run for a pair of minutes and then restart it does it work? 4) using the `kdebugdialog` activate the output for the following areas: [50003] [50004] [50005] [50006] [50007] [51000] [51001] [digikam] [showfoto] [unnamed app] then run digikam from the command line, should give a lot of output please attach at least the structure of the db and the digikam log to this bug This is digikam output after 4). $ digikam digikam(25800)/kdeui (KIconLoader) KIconThemeDir::KIconThemeDir: Invalid Context= "Apps" line for icon theme: "/usr/share/icons/Mist/22x22/apps" digikam(25800)/kdeui (KIconLoader) KIconThemeDir::KIconThemeDir: Invalid Context= "Apps" line for icon theme: "/usr/share/icons/Mist/16x16/apps" digikam(25800)/kdeui (KIconLoader) KIconThemeDir::KIconThemeDir: Invalid Context= "Apps" line for icon theme: "/usr/share/icons/Mist/32x32/apps" digikam(25800)/kdeui (KIconLoader) KIconThemeDir::KIconThemeDir: Invalid Context= "Apps" line for icon theme: "/usr/share/icons/Mist/48x48/apps" digikam(25800)/kdeui (KIconLoader) KIconThemeDir::KIconThemeDir: Invalid Context= "Apps" line for icon theme: "/usr/share/icons/Mist/24x24/apps" digikam(25800)/kdeui (KIconLoader) KIconThemeDir::KIconThemeDir: Invalid Context= "Apps" line for icon theme: "/usr/share/icons/Mist/256x256/apps" digikam(25800)/digikam (core) Digikam::KInotify::Private::open: Successfully opened connection to inotify: 17 digikam(25800)/digikam (core) Digikam::AlbumManager::setDatabase: DatabaseParameters: [ Type "QMYSQL", Name "digikam" (Thumbnails Name "digikam"); ConnectOptions: "UNIX_SOCKET=/home/serge/.kde4/share/apps/digikam/db_misc/mysql.socket", Username and Password: "root", ""] QSqlDatabasePrivate::removeDatabase: connection 'ConnectionTest' is still in use, all queries will cease to work. digikam(25800)/digikam (core) Digikam::DatabaseConfigElementLoader::readConfig: Loading SQL code from config file "/usr/share/apps/digikam/database/dbconfig.xml" digikam(25800)/digikam (core) Digikam::DatabaseConfigElementLoader::readConfig: false "1" 1 1 digikam(25800)/digikam (core) Digikam::SchemaUpdater::update: SchemaUpdater update digikam(25800)/digikam (core) Digikam::SchemaUpdater::startUpdates: Have a database structure version 5 digikam(25800)/digikam (core) Digikam::SchemaUpdater::makeUpdates: makeUpdates 5 to 6 digikam(25800)/digikam (core) Digikam::DatabaseCoreBackendPrivate::debugOutputFailedQuery: Failure executing query: "" Error messages: "QMYSQL: Unable to execute query" "PROCEDURE digikam.create_index_if_not_exists does not exist" 1305 2 Bound values: () digikam(25800)/digikam (core) Digikam::DatabaseCoreBackend::execDBAction: Error while executing DBAction [ "UpdateSchemaFromV5ToV6" ] Statement [ "CALL create_index_if_not_exists('ImageTags','tag_id_index','imageid');" ] digikam(25800)/digikam (core): Schema update to V6 failed! the (mysql digikam code) problem is that you're using two different databases for images and thumbnails. try to execute the following SQL in both databases, and then restart digikam: DROP PROCEDURE IF EXISTS create_index_if_not_exists; delimiter ;; CREATE PROCEDURE create_index_if_not_exists(table_name_vc varchar(50), index_name_vc varchar(50), field_list_vc varchar(1024), is_unique int) SQL SECURITY INVOKER BEGIN set @Index_cnt = ( SELECT COUNT(1) cnt FROM INFORMATION_SCHEMA.STATISTICS WHERE CONVERT(DATABASE() USING latin1) = CONVERT(TABLE_SCHEMA USING latin1) AND CONVERT(table_name USING latin1) = CONVERT(table_name_vc USING latin1) AND CONVERT(index_name USING latin1) = CONVERT(index_name_vc USING latin1) ); IF IFNULL(@Index_cnt, 0) = 0 THEN set @index_sql = CONCAT( CONVERT( 'ALTER TABLE ' USING latin1), CONVERT( table_name_vc USING latin1), CONVERT( IF(is_unique = 0, ' ADD INDEX ', ' ADD UNIQUE INDEX ') USING latin1), CONVERT( index_name_vc USING latin1), CONVERT( '(' USING latin1), CONVERT( field_list_vc USING latin1), CONVERT( ');' USING latin1) ); PREPARE stmt FROM @index_sql; EXECUTE stmt; DEALLOCATE PREPARE stmt; END IF; END ;; please confirm the problem has been "fixed" (a real fix is waiting for me to understand much better qt+threads+database). Ok, many thanks for quick answer, I will try tomorrow and send a feedback. Dear Francesco, it is not absolutely clear for me what do you mean by different databases. I have the following settings in digikamrc: [Database Settings] Database Connectoptions=UNIX_SOCKET=/home/serge/.kde4/share/apps/digikam/db_misc/mysql.socket Database Hostname= Database Name=digikam Database Name Thumbnails=digikam Database Password= Database Port=0 Database Type=QMYSQL Database Username=root Internal Database Server=false So, it seems that I have only one database "digikam" Created attachment 66581 [details]
Database structure
This is the digikam output after applying sql code from comment #3: digikam(20752)/digikam (core) Digikam::AlbumManager::setDatabase: DatabaseParameters: [ Type "QMYSQL", Name "digikam" (Thumbnails Name "digikam"); ConnectOptions: "UNIX_SOCKET=/home/serge/.kde4/share/apps/digikam/db_misc/mysql.socket", Username and Password: "root", ""] QSqlDatabasePrivate::removeDatabase: connection 'ConnectionTest' is still in use, all queries will cease to work. digikam(20752)/digikam (core) Digikam::DatabaseConfigElementLoader::readConfig: Loading SQL code from config file "/usr/share/apps/digikam/database/dbconfig.xml" digikam(20752)/digikam (core) Digikam::DatabaseConfigElementLoader::readConfig: false "1" 1 1 digikam(20752)/digikam (core) Digikam::SchemaUpdater::update: SchemaUpdater update digikam(20752)/digikam (core) Digikam::SchemaUpdater::startUpdates: Have a database structure version 5 digikam(20752)/digikam (core) Digikam::SchemaUpdater::makeUpdates: makeUpdates 5 to 6 digikam(20752)/digikam (core) Digikam::DatabaseCoreBackendPrivate::debugOutputFailedQuery: Failure executing query: "" Error messages: "QMYSQL: Unable to execute query" "Incorrect number of arguments for PROCEDURE digikam.create_index_if_not_exists; expected 4, got 3" 1318 2 Bound values: () digikam(20752)/digikam (core) Digikam::DatabaseCoreBackend::execDBAction: Error while executing DBAction [ "UpdateSchemaFromV5ToV6" ] Statement [ "CALL create_index_if_not_exists('ImageTags','tag_id_index','imageid');" ] digikam(20752)/digikam (core): Schema update to V6 failed! Please, help! Created attachment 66621 [details] MYSQL server log (running digikam after executing SQL code from comment #3) I have fixed somehow my problems by means of executing of SQL code from bug 283502. Seems to be a duplicate of 283502 *** This bug has been marked as a duplicate of bug 283502 *** Not reproducible with 7.0.0 beta1. |