Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007900TestLinkAPI - XMLRPCpublic2017-03-25 19:562018-04-15 10:36
Reporterlczub 
Assigned Tofman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Fixed in Version1.9.17 (2018 Q1) 
Summary0007900: (github code) API-XMLRPC - getExecutionSet raise database error
DescriptionProblem with latest TL DEV1.9.17 code from github ( commit 1ee5f78 ):
- calling xml-rpc api method getExecutionSet raise a database error

reason is, that method TestlinkXMLRPCServer->getExecutionSet builds a
sql statement without a WHERE keyword
Steps To Reproducesend: b'POST /testlink-dev/lib/api/xmlrpc/v1/xmlrpc.php HTTP/1.1\r\nHost: lkatlinkd7\r\nAccept-Encoding: gzip\r\nContent-Type: text/xml\r\nUser-Agent: Python-xmlrpc/3.6\r\nContent-Length: 585\r\n\r\n'

send: b"<?xml version='1.0'?>\n<methodCall>\n<methodName>tl.getExecutionSet</methodName>\n<params>\n
<param>\n<value><struct>\n<member>\n<name>devKey</name>\n<value>

<string>94cc922ff3a62291a7cb9c4adbb60501</string></value>\n</member>\n<member>\n<name>testplanid</name>\n<value>
<string>15216</string></value>\n</member>\n<member>\n<name>testcaseid</name>\n<value>

<string>15229</string></value>\n</member>\n<member>\n<name>platformid</name>\n<value><string>1108</string></value>\n</member>\n<member>\n<name>buildid</name>\n<value><string>882</string></value>\n</member>\n</struct></value>\n</param>\n</params>\n</methodCall>\n"
reply: 'HTTP/1.1 200 OK\r\n'

header: Date header: Server header: Vary header: Content-Encoding header: Content-Length header: Content-Type body: b'
 ============================================================================== 
 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( SELECT * FROM  executions WHERE id  IN (SELECT id AS exec_id FROM executions  AND build_id = 882 AND platform_id = 1108) ORDER BY id  ASC, -1) called at [/usr/local/www/testlink-git/lib/functions/database.class.php:647]\n#1  database->fetchRowsIntoMap( SELECT * FROM  executions WHERE id  IN (SELECT id AS exec_id FROM executions  AND build_id = 882 AND platform_id = 1108) ORDER BY id  ASC, id) called at [/usr/local/www/testlink-git/lib/api/xmlrpc/v1/xmlrpc.class.php:8295]\n#2  TestlinkXMLRPCServer->getExecut'
Additional InformationSuggestion for fix

Wrong sql statement caused by ';' typo in xmlrpc.class.php:8273
      $sql = " SELECT * FROM {$this->tables['executions']} WHERE id " .
             " IN (SELECT id AS exec_id FROM {$this->tables['executions']} ";
             " WHERE testplan_id = {$tplan_id} " .

Fixed sql statement
      $sql = " SELECT * FROM {$this->tables['executions']} WHERE id " .
             " IN (SELECT id AS exec_id FROM {$this->tables['executions']} " .
             " WHERE testplan_id = {$tplan_id} " .
TagsNo tags attached.
Database (MySQL,Postgres,etc)postgresql 9.6.2
Browser
PHP Version
TestCaseID
QA Team - Task Workflow StatusREADY FOR TESTING
Attached Files

- Relationships

-  Notes
(0026203)
fman (administrator)
2017-03-27 05:42

thansk
(0026214)
lczub (reporter)
2017-03-28 09:39

Retest with github commit 0c8feb6 passed

Calling xml-rpc api method getExecutionSet with optional arguments 'platformid', 'platformname', 'buildid' or 'buildname' raises no database error
(0027392)
fman (administrator)
2018-04-15 10:36

released

- Issue History
Date Modified Username Field Change
2017-03-25 19:56 lczub New Issue
2017-03-27 05:41 fman QA Team - Task Workflow Status => TBD
2017-03-27 05:41 fman Description Updated View Revisions
2017-03-27 05:41 fman Steps to Reproduce Updated View Revisions
2017-03-27 05:41 fman Additional Information Updated View Revisions
2017-03-27 05:42 fman Steps to Reproduce Updated View Revisions
2017-03-27 05:42 fman Note Added: 0026203
2017-03-27 05:43 fman QA Team - Task Workflow Status TBD => READY FOR TESTING
2017-03-27 05:43 fman Status new => resolved
2017-03-27 05:43 fman Fixed in Version => 1.9.17 (2018 Q1)
2017-03-27 05:43 fman Resolution open => fixed
2017-03-27 05:43 fman Assigned To => fman
2017-03-28 09:39 lczub Note Added: 0026214
2018-04-15 10:36 fman Note Added: 0027392
2018-04-15 10:36 fman Status resolved => closed



Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker