Bug 233763

Summary: SETUP : Using mysql server with invalid settings is "possible"
Product: [Applications] digikam Reporter: Johannes Wienke <languitar>
Component: Setup-DatabaseAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: 1.3.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Unspecified   
Latest Commit: Version Fixed In: 5.0.0
Sentry Crash Report:

Description Johannes Wienke 2010-04-08 20:05:08 UTC
Version:           trunk (using KDE 4.4.2)
Installed from:    Archlinux Packages

It should not be possible to change to mysql backend and submit the settings dialog if the settings don't work. right now it is possible to to submit the dialog with empty schema names. This results in a cascade of error messages. This is an obvious error that should be caught directly in the settings gui.

Also I'd suggest to perform a connection test before submitting the settings and warn if they don't work (with an options to ignore this warning because the mysql server may be down or whatever reason).

The connection test should not only check that the login is possible. It also needs to verify that appropriate permissions exist.
Comment 1 caulier.gilles 2011-12-15 08:57:21 UTC
Johannes,

This file still valid using 2.x serie ?

Gilles Caulier
Comment 2 Johannes Wienke 2011-12-15 09:53:18 UTC
So, first think I notice is that when I switch from SQLite to MySQL, the two schema fields are filled with the full paths to the SQlite databases, which should not be the case.

Except from that nothing changed. I can confirm the dialog without any valid settings. A validation before pressing ok would be really good.
Comment 3 caulier.gilles 2015-11-26 14:10:01 UTC
Git commit fd70d94590c34cdb2daed078923f4a9ff6cbc302 by Gilles Caulier.
Committed on 26/11/2015 at 13:59.
Pushed by cgilles into branch 'master'.

factoring setup database and first run assistant about DB config view.
Share same code to check DB setup.
Currently, SQlite and Mysql internal server settings are parsed.
TODO : Check Mysql server settings validity

M  +5    -1    app/main/main.cpp
M  +35   -33   libs/album/albummanager.h
M  +1    -2    libs/database/engine/dbengineparameters.h
M  +99   -78   libs/database/utils/dbsettingswidget.cpp
M  +8    -3    libs/database/utils/dbsettingswidget.h
M  +1    -1    libs/database/utils/scancontroller.cpp
M  +2    -2    utilities/firstrun/assistantdlg.cpp
M  +2    -1    utilities/firstrun/assistantdlg.h
M  +12   -137  utilities/firstrun/databasepage.cpp
M  +3    -5    utilities/firstrun/databasepage.h
M  +5    -0    utilities/setup/setupdatabase.cpp

http://commits.kde.org/digikam/fd70d94590c34cdb2daed078923f4a9ff6cbc302
Comment 4 caulier.gilles 2015-11-26 15:20:24 UTC
Git commit b17431ab16bdd9a24ef8294be77e8914e9726a65 by Gilles Caulier.
Committed on 26/11/2015 at 15:09.
Pushed by cgilles into branch 'master'.

Add more Mysql server settings checks :
- DB names are limited to ASCII
- empty fields are not allowed
- a DB connection is processed before to validate configuration
FIXED-IN: 5.0.0

M  +1    -0    NEWS
M  +0    -2    libs/database/README.MYSQL
M  +155  -69   libs/database/utils/dbsettingswidget.cpp
M  +5    -5    libs/database/utils/dbsettingswidget.h
M  +1    -1    utilities/firstrun/databasepage.cpp
M  +1    -1    utilities/setup/setupdatabase.cpp

http://commits.kde.org/digikam/b17431ab16bdd9a24ef8294be77e8914e9726a65
Comment 5 caulier.gilles 2015-11-27 07:37:17 UTC
Git commit 0ed6636763b1b4d5d0170c55c2b2e19b2298307c by Gilles Caulier.
Committed on 27/11/2015 at 07:22.
Pushed by cgilles into branch 'master'.

Redesign settings layout for Mysql server settings.
Group connection options together + Check connection button.
Add separator
Group database names options together + Reset default button.

M  +52   -45   libs/database/utils/dbsettingswidget.cpp
M  +2    -1    libs/database/utils/dbsettingswidget.h

http://commits.kde.org/digikam/0ed6636763b1b4d5d0170c55c2b2e19b2298307c