Issue when migrating sqlite to mysql

Christoph Huckle chrihuc at gmail.com
Tue Aug 23 07:33:00 BST 2016


Okay, I found the issue: imageid = 0, there is no image existing in the
table "Images" but there is an entry with that ID in the table
"ImageInformation".

Would be good to have this exception catched and handled, in case that
happens for others.

BR
Christoph

Christoph Huckle <chrihuc at gmail.com> schrieb am Fr., 19. Aug. 2016 um
14:06 Uhr:

> Hello Gents,
>
> I've looked in the bug reports and also in the mail-list but couldn't
> solve this issue:
>
> I try to migrate my existing sqlite database into mysql and as soon as it
> starts copying over the imageinformation this error happens:
>
> digikam.dbengine: Failure executing query:
> "INSERT INTO ImageInformation (imageid, rating, creationDate,
> digitizationDate, orientation, width, height, format, colorDepth,
> colorModel) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"
> Error messages: "QMYSQL3: Der Befehl konnte nicht ausgeführt werden"
> "Cannot add or update a child row: a foreign key constraint fails
> (`digikam`.`ImageInformation`, CONSTRAINT `ImageInformation_Images` FOREIGN
> KEY (`imageid`) REFERENCES `Images` (`id`) ON DELETE CASCADE ON UPDATE
> CASCADE)" 1452 2
> Bound values:  (QVariant(qlonglong, 0), QVariant(qlonglong, 0),
> QVariant(QString, "2013-07-21T11:49:57"), QVariant(QString,
> "2013-07-21T11:49:57"), QVariant(qlonglong, 1), QVariant(qlonglong, 3024),
> QVariant(qlonglong, 2016), QVariant(QString, "JPG"), QVariant(qlonglong,
> 8), QVariant(qlonglong, 5))
> digikam.dbengine: Error while executing DBAction [
> "Migrate_Write_ImageInformation" ] Statement [ "INSERT INTO
> ImageInformation (imageid, rating, creationDate, digitizationDate,
> orientation, width, height, format, colorDepth, colorModel) VALUES
> (:imageid, :rating, :creationDate, :digitizationDate, :orientation, :width,
> :height, :format, :colorDepth, :colorModel);" ]
> digikam.coredb: Core database: error while converting table data. Details:
>  QSqlError("1452", "QMYSQL3: Der Befehl konnte nicht ausgeführt werden",
> "Cannot add or update a child row: a foreign key constraint
> fails(`digikam`.`ImageInformation`, CONSTRAINT `ImageInformation_Images`
> FOREIGN KEY (`imageid`) REFERENCES `Images` (`id`) ON DELETE CASCADE ON
> UPDATE CASCADE)")
>
> Tried it a few times, always the same error.
>
> Let me know if you need more information or if I shall open a bug report.
>
> Cheers
> Christoph
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/digikam-users/attachments/20160823/a4769346/attachment.html>


More information about the Digikam-users mailing list