Jump to content

Integrity Check for a Nested Set


marone42

Recommended Posts

Hello guys,

 

I have here a Database with a Nested Set (Nested Tree) Structure, with id, lft, rgt, root_id and parent_id. I think that the structure is not ok.I found some duplicate nodes and other inconsistencies.

 

So my question: does anyone of you guys have a hint (or maybe some test algos) for doing an integrity check of the tree? Maybe using the parent_ids (which are assigned correct) or so.

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/48593-integrity-check-for-a-nested-set/
Share on other sites

Hello,

 

i'm sorry, i wasn't precise enough. I want to check the integrity of the Nested Set structure, which has nothing to do with the parent_ids. Its structure consists only of the left and right nodes.

 

I know that the parent_id-Structure is ok, but this system works mainly with the nodes, i think the parent_id and root_id structure is only in the db for "backup".

 

I'm looking for a script that checks the integrity of the left and right nodes, if all trees are correct, maybe if the tree structure matches the parent_id-structure.

 

Regards

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.