MantisBT - TestLink
View Issue Details
0007159TestLinkDatabase Generalpublic2015-06-12 05:192015-09-19 08:49
highmajorunable to reproduce
1.9.13 (2015 #1) 
1.9.14 (2015 Q3) 
Multiple browsers
0007159: Projects disappeared
In our TestLink installation we observed that two test projects had disappeared. Unfortunately we do not know what sequence of actions led to this. We think it occurred when someone was working on a different project, not one of the disappearing projects.

On investigation we found that the first two records of table node_hierarchy (ids 1 and 2) had been deleted. On recreating these two records manually, the projects were once again available, including all test suites and test cases. (To me this implies a software bug, not a user error; in any case no-one has the rights to delete projects).

On investigating the code, there are several lines of the general form:
$sql = "DELETE FROM {$this->tables['nodes_hierarchy']} WHERE parent_id IN ( {$implosion} ) ";
It seems likely that one of these lines has been invoked with incorrect ids, in our case 1 and 2.

Tracking this bug down is not easy. HOWEVER it is possible - and very desirable - to mitigate it (and also potential similar bugs in future). This is done by adjusting the SQL used to delete records from node_hierarchy to only delete records of the correct node_type_id. Thus for example the routine delete_step_by_id should be adjusted to only delete records of node_type 'testcase_step'.

This could well be the same as issue 7041.
Bug itself: not known.

Mitigation: see code lines containing "DELETE FROM {$this->tables['nodes_hierarchy']}"
It may be useful to know that we have not yet made any use of the Requirements feature in TestLink. This would appear to limit the number of places where this could go wrong to four: testcase.class.php, testplan.class.php, testproject.class.php or testsuite.class.php.
No tags attached.
child of 0006830closed fman Availables hot-fixes for 1.9.13 & How To get full fixed package from GitHub 
Issue History
2015-06-12 05:19StephenPNew Issue
2015-06-13 08:27fmanAssigned To => fman
2015-06-13 08:27fmanStatusnew => assigned
2015-06-13 08:27fmanQA Team - Task Workflow Status => TBD
2015-06-13 09:34fmanNote Added: 0023493
2015-06-13 09:56fmanNote Added: 0023494
2015-06-13 10:48fmanNote Added: 0023495
2015-06-13 10:48fmanQA Team - Task Workflow StatusTBD => READY FOR TESTING
2015-06-13 10:48fmanStatusassigned => resolved
2015-06-13 10:48fmanFixed in Version => 1.9.14 (2015 Q3)
2015-06-13 10:48fmanResolutionopen => fixed
2015-06-13 10:48fmanRelationship addedchild of 0006830
2015-09-19 08:49fmanNote Added: 0023924
2015-09-19 08:49fmanStatusresolved => closed

2015-06-13 09:34 [^] [^] [^]
2015-06-13 09:56 [^]
2015-06-13 10:48 [^] [^]
2015-09-19 08:49   
1.9.14 Padawan - released - 2015-09-19