[digikam] [Bug 368734] Moving a hierarchy of tags (a tag with subtags) doesn't work and can lead to losing the complete hierarchy

bugzilla_noreply at kde.org bugzilla_noreply at kde.org
Tue Dec 13 06:50:07 GMT 2016


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

--- Comment #14 from swatilodha27 at gmail.com ---
(In reply to Maik Qualmann from comment #13)
> Swati,
> 
> the problem is this trigger in the SQLite DB. It only works with one tag,
> not with a tags tree.
> 
> <statement mode="plain">CREATE TRIGGER move_tagstree UPDATE OF pid ON Tags
Is this because only one pid is written in this UPDATE query? I think we should
include all the pids for handling Tags Tree?

> BEGIN
> DELETE FROM TagsTree
>     WHERE
>     ((id = OLD.id)
>     OR
>     id IN (SELECT id FROM TagsTree WHERE pid=OLD.id))
>     AND
>     pid IN (SELECT pid FROM TagsTree WHERE id=OLD.id);
> INSERT INTO TagsTree
>     SELECT NEW.id, NEW.pid
>     UNION
>     SELECT NEW.id, pid FROM TagsTree WHERE id=NEW.pid
>     UNION
>     SELECT id, NEW.pid FROM TagsTree WHERE pid=NEW.id
>     UNION
>     SELECT A.id, B.pid FROM TagsTree A, TagsTree B
>     WHERE
>     A.pid = NEW.id AND B.id = NEW.pid;
> END;</statement>
> 
> Maik

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Digikam-devel mailing list