MantisBT - TestLink
View Issue Details
0008518TestLinkTest Plan - Add/Remove Test Casespublic2018-12-20 12:362018-12-24 08:23
cartman 
fman 
normalminoralways
resolvedfixed 
1.9.18 (2018 Q3) 
1.9.19 (2019 Q1) 
Postgres
Chrome 62.0.3202.89
7.0.31
READY FOR TESTING
0008518: database error when removing testcase from testplan
when deleting test cases from a test plan the next day after adding to the test plan, a database error occurs

 ==============================================================================
 DB Access Error - debug_print_backtrace() OUTPUT START
 ATTENTION: Enabling more debug info will produce path disclosure weakness (CWE-200)
            Having this additional Information could be useful for reporting
            issue to development TEAM.
 ==============================================================================
#0 database->exec_query( DELETE FROM executions WHERE testplan_id = 22080 AND ( (tcversion_id = 22108 AND platform_id = 17) ) ) called at [/app/testlink/lib/functions/testplan.class.php:1224]
#1 testplan->unlink_tcversions(22080, Array ([tcversion] => Array ([22107] => 22108),[platform] => Array ([17] => 17),[items] => Array ([22107] => Array ([17] => 22108)))) called at [/app/testlink/lib/plan/planAddTC.php:84]
1. On day x, follow the link test specification and create a new test case in the test suite

2. On day x, follow the link Add / Remove Test Cases link and perform the steps:
  2.1. Assign to user on add
  2.2. Select build
  2.3. check the selected test case and click the Add / Remove selected button

3. On day x, follow the link Execute Tests and pass the added test case

4. On day x+1,follow the link Add / Remove Test Cases link and perform the steps:
  4.1 Check executed test case for remove
  4.2 click the button Add / Remove selected
in the events we can see the following information:

ERROR ON exec_query () - database.class.php
-1 - ERROR: UPDATE or DELETE in the "executions" table violates the foreign key constraint "execution_tcsteps_execution_id_fkey" of the table "execution_tcsteps" DETAIL: By key (id) = (42625) There are still links in the "execution_tcsteps" table. - DELETE FROM executions WHERE testplan_id = 22080 AND (((tcversion_id = 22108 AND platform_id = 17))
THE MESSAGE: DELETE FROM executions WHERE testplan_id = 22080 AND ((tcversion_id = 22108 AND platform_id = 17)) Query failed: errorcode [-1] errormsg: ERROR: UPDATE or DELETE in the "executions" table violates the foreign key constraint "execution_tcsteps_execution_id_fkey" of the "execution_tcsteps" table DETAIL: The key (id) = (42625) still has links in the table "execution_tcsteps".

when removing executed test cases from a test plan on the same day after adding a plan to the test, there is no error, everything works.
No tags attached.
child of 0008397assigned fman Availables hot-fixes for 1.9.18 & How To get full fixed package from GitHub 
Issue History
2018-12-20 12:36cartmanNew Issue
2018-12-21 19:18fmanNote Added: 0028370
2018-12-22 12:58fmanQA Team - Task Workflow Status => READY FOR TESTING
2018-12-22 12:58fmanNote Added: 0028371
2018-12-22 12:58fmanStatusnew => resolved
2018-12-22 12:58fmanFixed in Version => 1.9.19 (2019 Q1)
2018-12-22 12:58fmanResolutionopen => fixed
2018-12-22 12:58fmanAssigned To => fman
2018-12-22 12:59fmanRelationship addedchild of 0008397
2018-12-24 07:43cartmanNote Added: 0028381
2018-12-24 08:23fmanNote Added: 0028382

Notes
(0028370)
fman   
2018-12-21 19:18   
Issue is not related to time, but to missing delete of test case step executions
(0028371)
fman   
2018-12-22 12:58   
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/f57eb7d56d9c6d69dcb61e19148e735c8191a35c [^]
(0028381)
cartman   
2018-12-24 07:43   
thanks this fix helped
works as expected
(0028382)
fman   
2018-12-24 08:23   
great!