Bug 307750

Summary: No path to mysqld set in server configuration [patch]
Product: [Applications] digikam Reporter: Carsten Pfeiffer <pfeiffer>
Component: Database-MysqlAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: caulier.gilles
Priority: NOR    
Version: 3.0.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 3.0.0

Description Carsten Pfeiffer 2012-10-02 21:03:01 UTC
I cannot use Digikam with mysql anymore. It refuses to start the mysql process. I suppose this is because of the following code in databaseserver.cpp:

const QString mysqldPath(DatabaseConfigElement::element(dbType).dbServerCmd);
//const QString mysqldPath("/usr/sbin/mysqld");
if ( mysqldPath.isEmpty() || mysqldPath.compare( QLatin1String( "SERVERCMD_MYSQL-NOTFOUND" ) ))
{
        kDebug() << "No path to mysqld set in server configuration!";
        return DatabaseServerError(DatabaseServerError::StartError, i18n("No path to mysqld set in server configuration."));
}

The method always aborts when the mysqldPath is either empty or != "SERVERCMD_MYSQL-NOTFOUND". So unless your mysqld binary is named like that, digikam refuses to start it. You should rather use the == operator than compare().

Reproducible: Always

Steps to Reproduce:
1. Configure digikam to use an internal mysql server
2. Invoke "Check Database Connection" or just restart digikam
Actual Results:  
Digikam is unable to start mysqld and thus cannot connect to the database.

Expected Results:  
Digikam starts mysqld properly.

I'd classify this as major, because I cannot access my images from digikam anymore.
Comment 1 caulier.gilles 2012-10-03 06:08:21 UTC
yes, i can confirm code commented in 3.0.0.

Francesco, what do you think about ?

Gilles Caulier
Comment 2 Carsten Pfeiffer 2012-10-11 19:37:32 UTC
Do you want me to send a patch?
Comment 3 Carsten Pfeiffer 2013-01-08 22:16:07 UTC
*ping* pretty please, fix this before 3.0. It's really trivial.

I can also commit this myself, if you prefer that.
Comment 4 caulier.gilles 2013-01-09 07:55:27 UTC
Carsten,

You is welcome to commit this patch in git/master...

Best

Gilles Caulier
Comment 5 Carsten Pfeiffer 2013-01-10 21:05:46 UTC
Git commit 62ec1eae9e92b70f8dcc0e848c3f9bb1692f49c2 by Carsten Pfeiffer.
Committed on 10/01/2013 at 21:59.
Pushed by pfeiffer into branch 'master'.
FIXED-IN: 3.0

Make internal mysql server work again.

M  +1    -1    databaseserver/databaseserver.cpp

http://commits.kde.org/digikam/62ec1eae9e92b70f8dcc0e848c3f9bb1692f49c2