Bug 165318 - Digikam doesn't start because of SQL
Summary: Digikam doesn't start because of SQL
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Scan (show other bugs)
Version: 0.10.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-29 14:22 UTC by Carsten Niehaus
Modified: 2017-07-25 13:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 0.10.0


Attachments
qtsqlite driver detect during cmake configure of digikam (30.00 KB, patch)
2008-07-03 04:13 UTC, Ronald L. Humble
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carsten Niehaus 2008-06-29 14:22:42 UTC
Version:           KDE4 (using KDE 4.0.83)
Installed from:    Compiled From Sources
Compiler:          GCC 4.3.1 

Starting Digikam (KDE 4 version, compiled today on OpenSUSE 11) doesn't work. I am getting thousands of lines like the following. It stops with "Speicherzugriffsfehler". That is a segmentation fault.


QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers:
QSqlDatabasePrivate::removeDatabase: connection 'digikamDatabase-138070288' is still in use, all queries will cease to work.
QSqlDatabasePrivate::addDatabase: duplicate connection name 'digikamDatabase-138070288', old connection removed.
QSqlQuery::prepare: database not open
digikam(19608): Failure executing query:
digikam(19608): ""
digikam(19608): "Driver not loaded Driver not loaded"
digikam(19608): Bound values:  ()
QSqlQuery::prepare: database not open
digikam(19608): Failure executing query:
digikam(19608): ""
digikam(19608): "Driver not loaded Driver not loaded"
digikam(19608): Bound values:  ()
QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers:
QSqlDatabasePrivate::removeDatabase: connection 'digikamDatabase-138070288' is still in use, all queries will cease to work.
QSqlDatabasePrivate::addDatabase: duplicate connection name 'digikamDatabase-138070288', old connection removed.
QSqlQuery::prepare: database not open
digikam(19608): Failure executing query:
digikam(19608): ""
digikam(19608): "Driver not loaded Driver not loaded"
digikam(19608): Bound values:  ()
QSqlQuery::prepare: database not open
digikam(19608): Failure executing query:
digikam(19608): ""
digikam(19608): "Driver not loaded Driver not loaded"
digikam(19608): Bound values:  ()
QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers:
QSqlDatabasePrivate::removeDatabase: connection 'digikamDatabase-138070288' is still in use, all queries will cease to work.
QSqlDatabasePrivate::addDatabase: duplicate connection name 'digikamDatabase-138070288', old connection removed.
Speicherzugriffsfehler
Comment 1 caulier.gilles 2008-06-29 14:26:15 UTC
Carsten,

Install QT4 SQLite3 plugin, and all will be fine.

Gilles Caulier
Comment 2 Carsten Niehaus 2008-06-29 14:30:20 UTC
libqt4-sql-sqlite works, yes. Shouldn't this be caught by CMake?
Comment 3 caulier.gilles 2008-06-29 14:34:11 UTC
Well, there is no CMake script to detect Qt4::Sqlite3 plugin. All contribution are welcome....

Gilles Caulier
Comment 4 Marcel Wiesweg 2008-06-29 19:48:41 UTC
First thing: How to handle this problem if it occurs. It's a runtime dependency, and some time ago it did not crash but the error was detected and a message box displayed. You dont test too often with a broken setup, seems I should do that sometimes.

Second: How to avoid the situation. It's clear that distro packages must contain the SQlite plugin as a hard dependency. For compilation, I dont know how to detect Qt plugins.
Comment 5 caulier.gilles 2008-06-30 10:56:19 UTC
Marcel,

Why not to use this staic method at startup:

http://doc.trolltech.com/4.3/qsqldatabase.html#isDriverAvailable

Just to be sure than Sqlite3 Qt4 DB drivers is available. If not, open a message box to ping user and stop digiKam.

Gilles Caulier
Comment 6 Marcel Wiesweg 2008-06-30 17:27:33 UTC
SVN commit 826363 by mwiesweg:

Make sure that initialization errors are passed on to the user.
CCBUG: 165318


 M  +9 -0      scancontroller.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=826363
Comment 7 Marcel Wiesweg 2008-06-30 17:27:41 UTC
SVN commit 826364 by mwiesweg:

Avoid endless loop when database setup is broken
(CollectionManager would create new DatabaseAccess objects, the constructor
 would again call CollectionManager)

BUG: 165318


 M  +19 -2     databaseaccess.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=826364
Comment 8 Ronald L. Humble 2008-07-03 04:13:24 UTC
Created attachment 25803 [details]
qtsqlite driver detect during cmake configure of digikam

Attached is a tarball containing a svn diff on digikam/CMakeLists.txt as well
as a directory digikam/qtsqlitedrv. Cmake attempts to compile and run the
program in the directory. Success indicates the driver is functional.

The output of this patch has been made “information only” at this time.
Should a modification of this patch make it to svn, the failure of qt-sqlite
driver detection should perhaps cause digikam to not be compiled.

The digikam/qtsqlitedrv/CMakeCache.txt file created by cmake would need to be
removed if a second cmake configure is attempted otherwise false results are
possible. I have not attempted to code this feature.

This was created and seems to work on GNU/Linux Fedora 9 on using an   Intel(R)
Core(TM)2 CPU	       6600  @ 2.40GHz processor

royboy626