[SQL] invalid result of uniqueHash

Markus Leuthold digikam at titlis.org
Sat Nov 26 17:43:37 GMT 2016


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/20161126/745fa26e/attachment.html>


More information about the Digikam-devel mailing list