MantisBT - TestLink
View Issue Details
0007159TestLinkDatabase Generalpublic2015-06-12 05:192015-09-19 08:49
StephenP 
fman 
highmajorunable to reproduce
closedfixed 
MySQLWindows7
1.9.13 (2015 #1) 
1.9.14 (2015 Q3) 
MySQL
Multiple browsers
READY FOR TESTING
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

Notes
(0023493)
fman   
2015-06-13 09:34   
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/566c8732057329ce9de55a04177e752595c59e9b [^]

https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/ae192dea3bddf7385b8284306aef2dd5d051675c [^]

https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/9f20e079e8f0b9864f64bc9fd421ffe3905c3a31 [^]
(0023494)
fman   
2015-06-13 09:56   
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/0b6758c2a8bddcf8e2fa28c23b42e56061762a47 [^]
(0023495)
fman   
2015-06-13 10:48   
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/feee7f983ca7849e08dd5f043e64d22fb13d38fc [^]

https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/a9d33601b5edd16be9139608d42cc52ffabc42b8 [^]
(0023924)
fman   
2015-09-19 08:49   
1.9.14 Padawan - released - 2015-09-19