[SQL] invalid result of uniqueHash
caulier.gilles at gmail.com
Sun Nov 27 20:40:21 GMT 2016
See the report below :
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,
> 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!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Digikam-devel