Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008541TestLinkTest Spec. - Keywordspublic2019-01-15 06:302019-01-15 11:52
Reportercartman 
Assigned Tofman 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSRed Hat Enterprise Linux ServerOS Version6.7
Product Version1.9.18 (2018 Q3) 
Fixed in Version 
Summary0008541: in TestLink 1.9.18 database error occurs when linking a keyword to a test suite.
Description==============================================================================
 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:testsuite - Method: getKeywordsForTSSet */
             SELECT fk_id AS tsuite_id, OKW.keyword_id
             FROM object_keywords OKW
             JOIN keywords KW
             ON KW.id = OKW.keyword_id
             WHERE fk_id IN ( 22214, )
             AND fk_table = 'nodes_hierarchy' , -1) called at [/app/testlink/lib/functions/database.class.php:718]
#1 database->fetchColumnsIntoMap( /* Class:testsuite - Method: getKeywordsForTSSet */
             SELECT fk_id AS tsuite_id, OKW.keyword_id
             FROM object_keywords OKW
             JOIN keywords KW
             ON KW.id = OKW.keyword_id
             WHERE fk_id IN ( 22214, )
             AND fk_table = 'nodes_hierarchy' , tsuite_id, keyword_id, 1) called at [/app/testlink/lib/functions/testsuite.class.php:2043]
0000002 testsuite->getKeywordsForTSSet(Array ([0] => 22214,[1] => )) called at [/app/testlink/lib/functions/testsuite.class.php:1993]
0000003 testsuite->addKeywordsDeep(22214, Array ([0] => 68)) called at [/app/testlink/lib/testcases/containerEdit.php:324]
Steps To Reproduce1. follow the link test specification and select test suite
suite in the tree of the left panel
2. select a keyword for the test suite and click button <Add Also to children (Test Suites)>
Additional InformationLog level ERROR
Timestamp 01/15/2019 09:27:26
Source DATABASE

ERROR ON exec_query () - database.class.php
-1 - ERROR: syntax error (approximate position: ")") LINE 6: WHERE fk_id IN (22214,) ^ - / * Class: testsuite - Method: getKeywordsForTSSet * / SELECT fk_id AS tsuite_id, OKW.keyword_id FROM object_keywords OKW JOIN keywords KW ON KW.id = OKW.keyword_id WHERE fk_id IN (22214,) AND fk_table = 'elements_hierarchy' - Method: getKeywordsForTSSet * / SELECT fk_id AS tsuite_id, OKW.keyword_id FROM object_keywords OKW JOIN keywords KW ON KW.id = OKW.keyword_id WHERE fk_id IN (22214,) : ERROR: syntax error (approximate position: ")") LINE 6: WHERE fk_id IN (22214,) ^
TagsNo tags attached.
Database (MySQL,Postgres,etc)Postgres
BrowserChrome 62.0.3202.89
PHP Version7.0.31
TestCaseID
QA Team - Task Workflow StatusTBD
Attached Files

- Relationships

-  Notes
(0028435)
hughkay (reporter)
2019-01-15 07:16
edited on: 2019-01-15 07:32

@fman: I can also confirm this bug. It occurs if a test suite does not have any child suites. Then the SQL query is created erroneously.
And I also got a solution for this:
In lib/functions/testsuite.class.php file a modification to the function "addKeywordsDeep()" is needed as following:

function addKeywordsDeep($rootTestSuiteID,$kwSet) {
    $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;

    // Get tree of Test Suites
    $tsList = $rootTestSuiteID;
    $tsListSub = $this->tree_manager->get_subtree_list($rootTestSuiteID,$this->my_node_type);
    if($tsListSub !== "") {
      $tsList .= ',' . $tsListSub;
    }

...

(0028436)
fman (administrator)
2019-01-15 11:41

@hughkay
thanks a lot, I'm going to check and provide fix
(0028438)
fman (administrator)
2019-01-15 11:48

@hugkhay
would you mind trying this?

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

please provide feedback

regards
(0028439)
hughkay (reporter)
2019-01-15 11:52

@fman:
Bugfix confirmed working.

- Issue History
Date Modified Username Field Change
2019-01-15 06:30 cartman New Issue
2019-01-15 07:16 hughkay Note Added: 0028435
2019-01-15 07:32 hughkay Note Edited: 0028435 View Revisions
2019-01-15 11:41 fman Note Added: 0028436
2019-01-15 11:48 fman Note Added: 0028438
2019-01-15 11:48 fman QA Team - Task Workflow Status => TBD
2019-01-15 11:48 fman Status new => resolved
2019-01-15 11:48 fman Resolution open => fixed
2019-01-15 11:48 fman Assigned To => fman
2019-01-15 11:52 hughkay Note Added: 0028439



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker