[Digikam-devel] [Bug 276356] New: tags should have a root (maybe hidden)

Francesco Riosa francesco+kde at pnpitalia.it
Thu Jun 23 19:48:27 BST 2011


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

           Summary: tags should have a root (maybe hidden)
           Product: digikam
           Version: 2.0.0
          Platform: Compiled Sources
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: NOR
         Component: Database
        AssignedTo: digikam-devel at kde.org
        ReportedBy: francesco+kde at pnpitalia.it


Version:           2.0.0 (using KDE 4.6.4) 
OS:                Linux

the "The Nested Set Model" used for the tags tree require to have one and only
one root. DK instead put many tags at the root level breaking this fundamental
assumption.

One example is the following query which should return the tree of tags by name
and depth

SELECT node.name, (COUNT(parent.name) - 1) AS depth
FROM tags AS node, tags AS parent
WHERE node.lft BETWEEN parent.lft AND parent.rgt
GROUP BY node.name
ORDER BY node.lft;

There are a pair of ways to overcome the current situation for existing and new
installations:
1) Use a different algorithm, I've in mind one that while has some limitation
for the tree depth is faster but need implementation
2) update existing trees at startup, put a root in place, update the parents of
each node w/o root and live with it. Since it would be a very bad idea have a
node with id 0 (it's a magic number in databases and math) we need to have a
root with id < 0 (or to dump and reload the table).

While at the moment I'm not able to point out specific bug introduced by this
behaviour it may cause many.


Reproducible: Always

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list