Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002129TestLinkAPI - XMLRPCpublic2009-02-19 22:092009-03-17 15:40
Reporterkcurran 
Assigned Tofman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version1.8 RC 4 
Fixed in Version1.8 RC 5 
Summary0002129: getTestCaseIDByName returns large number of instances
Description

When I look at the response to a getTestCaseIdByName, I see 8000 plus instances of the testcase, all with a different external id. This doesn't make seen to me. Why would there be so many external ids associated with a test case I just created yesterday

Calling the xmlrpc call with testcase name and testsuite name, or just calling with testcasename produces the same result.
Additional InformationLooking at the xmlrpc code, it didn't look like it was the problem, so I looked at the get_by_name call in testcase.clas.php. Seeing teh sql statement, I tried it to deteremine if the problem was in the database.

When I run the same mysql as in testcase.class.php for get_by_name,
I am returned 8135 entries from the query

Here is the sample of the sql, I used

mysql> select distinct NHA.id,NHA.name,NHB.parent_id,TCV.tc_external_id from nodes_hierarchy NHA, nodes_hierarchy NHB, tcversions TCV where NHA.name = 'Relay loops' and NHA.parent_id=NHB.id;

I get the same result for all test cases that I tried.

I'll send the DB export to Francisco since I don't want the DB in the public domain

This is consistent with the result I am seeing from the xmlrpc call.

This seems wrong, it's almost like I'm getting all possible entries from externalid=1..8135
TagsNo tags attached.
Database (MySQL,Postgres,etc)
Browser
PHP Version
TestCaseID
QA Team - Task Workflow Status
Attached Files

- Relationships

-  Notes
(0005553)
kcurran (reporter)
2009-02-20 01:24

Looking at the database, the magic number 8135 ( number of rows returned on the sql statement and xmlrpc call) is from the testprojects table ... the tc_counter field.
(0005554)
fman (administrator)
2009-02-20 02:15

thank for this hint, this help a lot.
(0005557)
kcurran (reporter)
2009-02-20 06:05

I changed the sql statement ( as following) in testcase.class.php and it seems to work

function get_by_name($name, $tsuite_name='', $tproject_name='')
{
    $filters_on=array('tsuite_name' => false, 'tproject_name' => false);

    $tsuite_name=trim($tsuite_name);
    $tproject_name=trim($tproject_name);

    $sql = " SELECT DISTINCT NHA.id,NHA.name,NHB.parent_id," .
           " NHB.name AS tsuite_name, TCV.tc_external_id " .
               " FROM nodes_hierarchy NHA, nodes_hierarchy NHB, nodes_hierarchy NHC, tcversions TCV " .
               " WHERE NHA.node_type_id = {$this->my_node_type} " .
               " AND NHA.name = '{$this->db->prepare_string($name)}' " .
               " AND NHA.parent_id=NHB.id " .
               " AND NHC.parent_id=NHA.id " .
               " AND TCV.id=NHC.id ";
(0005560)
fman (administrator)
2009-02-20 17:28

Thanks I will review and apply it
(0005574)
fman (administrator)
2009-02-22 01:42

please get last tarball and retest
(0005595)
fman (administrator)
2009-02-23 23:40

Access to tarballs - http://testlink.org/cvs_tarballs/ [^]
(0005597)
kcurran (reporter)
2009-02-24 05:40

I couldn't test with the tarball - I was getting the following error but I did test the fix by copying testcase.class.php into my RC4 source and it worked fine.

Warning: require_once(Smarty.class.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampplite\htdocs\testlink_head_export\lib\functions\common.php on line 109

Fatal error: require_once() [function.require]: Failed opening required 'Smarty.class.php' (include_path='.;C:\xampplite\php\pear\;.;C:\xampplite\htdocs\testlink_head_export\lib\functions\') in C:\xampplite\htdocs\testlink_head_export\lib\functions\common.php on line 109
(0005598)
kcurran (reporter)
2009-02-24 05:42

I get the fatal error message on my browser. With IE before I am asked to log in and with Firefox after I log in.

- Issue History
Date Modified Username Field Change
2009-02-19 22:09 kcurran New Issue
2009-02-20 01:12 fman Status new => assigned
2009-02-20 01:12 fman Assigned To => fman
2009-02-20 01:24 kcurran Note Added: 0005553
2009-02-20 02:15 fman Note Added: 0005554
2009-02-20 06:05 kcurran Note Added: 0005557
2009-02-20 17:28 fman Note Added: 0005560
2009-02-22 01:42 fman Note Added: 0005574
2009-02-23 23:40 fman Note Added: 0005595
2009-02-24 05:40 kcurran Note Added: 0005597
2009-02-24 05:42 kcurran Note Added: 0005598
2009-02-26 02:28 fman Status assigned => resolved
2009-02-26 02:28 fman Fixed in Version => next DEV - 1.8 RC 5
2009-02-26 02:28 fman Resolution open => fixed
2009-03-17 15:40 mhavlat Status resolved => closed
2013-04-25 17:30 fman Category TL API => XMLRPC API
2013-04-25 17:30 fman Category XMLRPC API => API - XMLRPC



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker