Bug 233763 - SETUP : Using mysql server with invalid settings is "possible"
Summary: SETUP : Using mysql server with invalid settings is "possible"
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Setup-Database (show other bugs)
Version: 1.3.0
Platform: Arch Linux Unspecified
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-08 20:05 UTC by Johannes Wienke
Modified: 2015-11-27 07:37 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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