[SQL] invalid result of uniqueHash

Gilles Caulier caulier.gilles at gmail.com
Sun Nov 27 20:40:21 GMT 2016


See the report below :

https://bugs.kde.org/show_bug.cgi?id=373003

Gilles Caulier

2016-11-26 18:43 GMT+01:00 Markus Leuthold <digikam at titlis.org>:

> Is there a reason why the uniqueHashVersion is not upgraded to v2 during
> the database schema upgrade to v8?
>
> I see that there are two versions of uniqueHash:
>
>  - DImgLoader::uniqueHash returns md5.result()
>  - DImgLoader::uniqueHashV2 returns md5.result().toHex()
>
> However, both hash versions are afterwards used the same way, ignoring the
> fact that only v2 is converted to hex. This doesn't feel right.
>
> I have a database schema v8, but still the old uniqueHash version. My
> settings table doesn't contain a uniqueHashVersion key
> I have a new image which results in the SQL error:
>
> "REPLACE INTO Images  ( album, name, status, category, modificationDate,
> fileSize, uniqueHash )  VALUES (?,?,?,?,?,?,?);"
> Error messages: "QMYSQL3: Unable to execute statement" "Incorrect string
> value: '\\xF1\\x9E\\xA6\\x87' for column 'uniqueHash' at row 1" 1366 2
> Bound values:  (QVariant(int, 118053), QVariant(QString, "P4240656.JPG"),
> QVariant(int, 1), QVariant(int, 1), QVariant(QString,
> "2016-10-30T19:16:42"), QVariant(qlonglong, 6951936), QVariant(QString,
> "m�7�\U0005E987"))
> digikam.dbengine: Failure executing query:
>
> My assumtion is that for this particular image, the uniqueHashV1 creates
> an "incorrect string value" in the SQL statement due to the missing toHex()
> It doesn't happen with other pictures, or what to you guys think?
>
> Instead of fixing this bug, it's probably better to upgrade the uniqueHash
> values to V2 in the next database schema update. How can I do that manually?
>
> thanks for helping!
> Kusi
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/digikam-devel/attachments/20161127/c66be9d6/attachment.html>


More information about the Digikam-devel mailing list