Bug 355893

Summary: MYSQL : Agnostic on unix filenames (upper ne lower), creates rename problems
Product: [Applications] digikam Reporter: Gerard Dirkse <gerard.dirkse>
Component: Database-MysqlAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: critical CC: caulier.gilles, gerard.dirkse, richm+kde, swatilodha27
Priority: NOR    
Version: 4.14.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 5.0.0
Sentry Crash Report:
Attachments: digikam1.2 initial list of files picture view
digikambug1.1
digikam1.3
digikambug1.4
digikambug1.5
digikam1.dbg
digikam2.dbg
digikam1.log

Description Gerard Dirkse 2015-11-25 14:48:55 UTC
Trying to reproduce bug reported in 324134 and create documentation for that. Using a test directory I copied 4 existing pictures in it,  left one as is(1), one suffix was changed (uppercase, 2), one renamed entirely (3), last (4) renamed as previous but difference in capitalisation (digikambug1.1 and digikambug1.2).  On opening digikam, only 1,2 and 4 were shown/recognised (digikambug1.3). The advanced rename was done (digikambug1.4), result was both as expected (reproduce 32414) where 4 disappeared (and 2 surprisingly not),  and unexpected because 3 reappeared (digikambug1.5).

In digkam1.dbg and digikam2.dbg is the output from traces as set by kdebugdialog. In digikam1.log is the mysql log from executed statements.

Reproducible: Always

Steps to Reproduce:
Refer to description

Actual Results:  
As described

Expected Results:  
1) Digikam should have recognised the 4 initial pictures in the album.
2) On rename all 4 pictures should still be there.

As highlighted in 324134, you can recover the apparent lost images by running fixing (?) queries against the database.
Comment 1 Gerard Dirkse 2015-11-25 14:51:02 UTC
Created attachment 95732 [details]
digikam1.2 initial list of files picture view

This is the contents of the test directory.
Comment 2 Gerard Dirkse 2015-11-25 14:52:38 UTC
Created attachment 95733 [details]
digikambug1.1

Initial file list
Comment 3 Gerard Dirkse 2015-11-25 14:54:37 UTC
Created attachment 95734 [details]
digikam1.3

Digikams initial view of the album, one is missing.
Comment 4 Gerard Dirkse 2015-11-25 14:55:20 UTC
Created attachment 95735 [details]
digikambug1.4

Rename the pictures
Comment 5 Gerard Dirkse 2015-11-25 14:56:10 UTC
Created attachment 95736 [details]
digikambug1.5

Result of rename, one disappeared, one missing showed up
Comment 6 Gerard Dirkse 2015-11-25 14:56:47 UTC
Created attachment 95737 [details]
digikam1.dbg

Debug log 1 from kdebugdialog
Comment 7 Gerard Dirkse 2015-11-25 14:57:24 UTC
Created attachment 95738 [details]
digikam2.dbg

digikam debug log 2 from kdebugdialog.
Comment 8 Gerard Dirkse 2015-11-25 14:57:54 UTC
Created attachment 95739 [details]
digikam1.log

MYSQL log from this test run.
Comment 9 Richard Mortimer 2015-11-26 14:32:25 UTC
We need to make sure that the MySQL schema for text fields specifies a collation value that compares strings in a case sensitive manner.

Useful background information at http://dev.mysql.com/doc/refman/5.7/en/case-sensitivity.html

I suspect that we should be using the utf8_bin collation.

http://dev.mysql.com/doc/refman/5.7/en/charset-charsets.html
Comment 10 swatilodha27 2016-07-03 08:02:08 UTC
 MySQL has been made case sensitive. It now uses utf8_bin collation.

Try digiKam 5.0.0 version.
Comment 11 swatilodha27 2016-07-03 08:42:57 UTC
This file is closed now. Feel free to reopen, with necessary updates, if you still face the issue.