MantisBT - TestLink
View Issue Details
0008627TestLinkKeywordspublic2019-04-09 09:462019-04-18 14:04
mshishodia 
fman 
highmajoralways
closedunable to reproduce 
1.9.19 (2019 Q1) 
 
MYSQL 5.7
FF
7.2.17
TBD
0008627: AFTER UPGRADE TP 1.9.19 - DB access error while filter test cases with keywords.
When user try to filter test case with keyword and hit apply button .

DB access error display.
Login in testlink.
go to Test Specification
now expand filter .
now selelect filter from keyword field.
now hit apply button.

DB access error display
" ==============================================================================

 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( /* Filter Type = OR */ SELECT TK.testcase_id FROM testcase_keywords TK JOIN latest_tcase_version_id LTVC ON LTVC.tcversion_id = TK.tcversion_id JOIN keywords KW ON KW.id = TK.keyword_id WHERE keyword_id IN (72) AND KW.testproject_id=387334, -1) called at [C:\Apache24\htdocs\testlink\lib\functions\database.class.php:637]
#1 database->fetchRowsIntoMap( /* Filter Type = OR */ SELECT TK.testcase_id FROM testcase_keywords TK JOIN latest_tcase_version_id LTVC ON LTVC.tcversion_id = TK.tcversion_id JOIN keywords KW ON KW.id = TK.keyword_id WHERE keyword_id IN (72) AND KW.testproject_id=387334, testcase_id) called at [C:\Apache24\htdocs\testlink\lib\functions\testproject.class.php:3469]
0000002 testproject->getTCLatestVersionFilteredByKeywords(387334, Array ([0] => 72), Or) called at [C:\Apache24\htdocs\testlink\lib\functions\treeMenu.inc.php:2488]
No tags attached.
jpg Testlink_Keyword.jpg (240,685) 2019-04-10 09:03
http://mantis.testlink.org/file_download.php?file_id=5132&type=bug
jpg
Issue History
2019-04-09 09:46mshishodiaNew Issue
2019-04-09 18:17fmanQA Team - Task Workflow Status => TBD
2019-04-09 18:17fmanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=5799#r5799
2019-04-09 18:18fmanNote Added: 0028689
2019-04-09 18:19fmanNote Edited: 0028689bug_revision_view_page.php?bugnote_id=28689#r5801
2019-04-10 09:02mshishodiaNote Added: 0028691
2019-04-10 09:03mshishodiaFile Added: Testlink_Keyword.jpg
2019-04-10 09:16fmanNote Added: 0028692
2019-04-10 09:17fmanSummaryDB access error while filter test cases with keywords. => AFTER UPGRADE TP 1.9.19 - DB access error while filter test cases with keywords.
2019-04-11 07:03mshishodiaNote Added: 0028699
2019-04-11 21:01fmanNote Added: 0028703
2019-04-16 17:56gnustavoNote Added: 0028729
2019-04-16 18:04fmanNote Added: 0028730
2019-04-18 14:04fmanNote Added: 0028737
2019-04-18 14:04fmanStatusnew => closed
2019-04-18 14:04fmanAssigned To => fman
2019-04-18 14:04fmanResolutionopen => unable to reproduce

Notes
(0028689)
fman   
2019-04-09 18:18   
(edited on: 2019-04-09 18:19)
details to reproduce are not enough.
complete scenario is needed starting from test project creation

give a look to http://mantis.testlink.org/view.php?id=7042 [^]

to understand the details needed

(0028691)
mshishodia   
2019-04-10 09:02   
1. I Upgrade testlink-1.9.19 .
2. login in Testlink .
3. Go to Test Specification
4. Now filter test case with existing Keywords .
5. Hit apply button.
(0028692)
fman   
2019-04-10 09:16   
The IMPORTANT fact is I Upgrade testlink-1.9.19, then issue can be in how you have executed the upgrading process.

Only way to have a chance to provide help => a copy of your db in the initial state is needed.
(0028699)
mshishodia   
2019-04-11 07:03   
Config DB file copied to new testlink, still DB access error display
(0028703)
fman   
2019-04-11 21:01   
without having a copy of YOUR database BEFORE migration I can not provide help and will be forced to close the issue
(0028729)
gnustavo   
2019-04-16 17:56   
Hi. I had a similar issue after upgrading to version 1.9.19. I'm going to open another issue, but I guess it's the same root cause.

By the error message you got, the SQL was generated at https://github.com/TestLinkOpenSourceTRMS/testlink-code/blob/1.9.19/lib/functions/testproject.class.php#L3456. [^]

The variable $kwFilter, expanded on line 3463, is defined in line 3412 like this:

  " keyword_id IN (" . implode(',',$keySet) . ")"

I guess the problem is that the field "keyword_id" is ambiguous in the SQL. In line 3462, for example, it's prefixed with "TK". I think it probably should be prefixed also in line 3412. But since the variable $kwFilter is expanded in more than one SQL expressions you have to unify the prefix in all of them.
(0028730)
fman   
2019-04-16 18:04   
1. it's important to try the guessings using a sql client, this way we can be sure issue is the missing alias.

2. it's important that everyone do tests on 1.9.19.01 branch that can be downloads from github, because this branch has been used to provide only fixes.

3. It's also important to search in this mantis for similar issues.

regards
(0028737)
fman   
2019-04-18 14:04   
no more user feedback