<div dir="ltr"><span style="font-size:12.8px">Hello.</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I was facing this error from past few days: </div><div style="font-size:12.8px"><br></div><blockquote class="gmail_quote" style="font-size:12.8px;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span style="font-family:monospace"><span style="color:rgb(0,0,0)">MariaDB [digikam]> update Albums set albumRoot=0 where id=10; </span><br>ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`digikam`.`Albums`, CONSTRAINT `Albums_AlbumRoot<br>s` FOREIGN KEY (`albumRoot`) REFERENCES `AlbumRoots` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)<br><br></span></blockquote><div style="font-size:12.8px"> </div><div style="font-size:12.8px">I figured out that as 'id' is AlbumRoots table is not 0. So 'albumRoot' in Images table can't be set to 0. This is I think the possible reason for FK constraint failing.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I used this statement instead & it worked:</div><div style="font-size:12.8px"><br></div><blockquote class="gmail_quote" style="font-size:12.8px;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span style="font-family:monospace"><span style="color:rgb(0,0,0)">MariaDB [digikam]> update Albums set albumRoot=1 where id=10;  </span><br><span style="font-weight:bold;color:rgb(0,0,0)">Query OK, 0 rows affected (0.06 sec)</span><span style="color:rgb(0,0,0)"> </span><br><span style="font-weight:bold;color:rgb(0,0,0)">Rows matched: 1  Changed: 0  Warnings: 0</span></span></blockquote><span class="im" style="font-size:12.8px"><div><br></div><div>Please look into this.</div><div><br></div><div>Regards </div></span></div><div hspace="streak-pt-mark" style="max-height:1px"><img style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=ac3dhdGlsb2RoYTI3QGdtYWlsLmNvbQ%3D%3D&type=zerocontent&guid=2f79f27c-aab8-4434-9ddc-e9ed7060f3a6"><font color="#ffffff" size="1">ᐧ</font></div>