MantisBT - TestLink
View Issue Details
0008524TestLinkTest Specificationpublic2018-12-24 08:462018-12-24 14:19
cartman 
fman 
normalminoralways
resolvedfixed 
Red Hat Enterprise Linux Server6.7
1.9.18 (2018 Q3) 
1.9.19 (2019 Q1) 
Postgres
Chrome 62.0.3202.89
7.0.31
READY FOR TESTING
0008524: Postgres - crash due to FK when removing step from executed testcase
when deleting step from an executed test case 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(/* Class:testcase - Method: delete_step_by_id */ DELETE FROM tcsteps WHERE id IN (22219) ) called at [/app/testlink/lib/functions/testcase.class.php:5456]
#1 testcase->delete_step_by_id(22219) called at [/app/testlink/lib/testcases/testcaseCommands.class.php:756]
0000002 testcaseCommands->doDeleteStep(stdClass Object ([assigned_keywords_list] => ,[container_id] => 0,[file_id] => 0,[tcase_id] =>latest_tcase_version_number,[latest_tcase_version_id] => latest_tcase_version_id,[latest_req_version] => latest_req_version,[latest_req_version_id] => latest_req_version_id,[latest_rspec_revision] => latest_rspec_revision),[*auditCfg] => stdClass Object ([eventSource] => GUI,[logEnabled] => 1)),[21] => tlRight Object (
1.follow the link test specification and perform the steps:
 1.1. create a new test case in the test suite
 1.2. add a new step in the test case

2. follow the link Add / Remove Test Cases link and assign test-case to user

3. follow the link Execute Tests and perform the steps:
 3.1. pass the test step marking it passed
 3.2. pass the test case setting the result as passed

4.follow the link test specification and perform the steps:
  4.1. select the passed test case in the test tree in the left pane
  4.2. remove test step from test case
the events have the following information:

ERROR ON exec_query () - database.class.php
-1 - ERROR: UPDATE or DELETE in the "tcsteps" table violates the foreign key "execution_tcsteps_tcstep_id_fkey" of the table "execution_tcsteps" DETAIL: On the key (id) = (22219) There are still links in the "execution_tcsteps" table. - / * Class: testcase - Method: delete_step_by_id * / DELETE FROM tcsteps WHERE id IN (22219)
THE MESSAGE: / * Class: testcase - Method: delete_step_by_id * / DELETE FROM tcsteps WHERE id IN (22219) Query failed : errorcode [-1] errormsg: ERROR: UPDATE or DELETE in the "tcsteps" table violates the foreign key constraint "execution_tcsteps_tcstep_id_fkey" of the "execution_tcsteps" table
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-24 08:46cartmanNew Issue
2018-12-24 11:27fmanNote Added: 0028385
2018-12-24 11:29fmanQA Team - Task Workflow Status => TBD
2018-12-24 11:29fmanDescription Updatedbug_revision_view_page.php?rev_id=5703#r5703
2018-12-24 11:30fmanNote Added: 0028386
2018-12-24 12:53fmanSummarydatabase error when removing step from executed testcase => Postgres - crash due to FK when removing step from executed testcase
2018-12-24 12:55fmanQA Team - Task Workflow StatusTBD => READY FOR TESTING
2018-12-24 12:55fmanNote Added: 0028387
2018-12-24 12:55fmanStatusnew => resolved
2018-12-24 12:55fmanFixed in Version => 1.9.19 (2019 Q1)
2018-12-24 12:55fmanResolutionopen => fixed
2018-12-24 12:55fmanAssigned To => fman
2018-12-24 12:55fmanRelationship addedchild of 0008397
2018-12-24 14:19cartmanNote Added: 0028388

Notes
(0028385)
fman   
2018-12-24 11:27   
Please do not add tons of text that make things impossible to read.
Take the time to analyze the error, and provide the significant text.
(0028386)
fman   
2018-12-24 11:30   
isssue arise due to FK in postgres.
Going to fix
(0028387)
fman   
2018-12-24 12:55   
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/fa8a138959085b921975d2f0c86b5393aaa81681 [^]
(0028388)
cartman   
2018-12-24 14:19   
thank you so much fman! This fix resolves the issue. Now deleting a step works as expected.