MantisBT - TestLink
View Issue Details
0008692TestLinkInternal issuepublic2019-06-13 19:132019-06-16 11:03
lczub 
fman 
highcrashalways
assignedopen 
 
 
psql 9.6.12
5
0008692: (github code) - corrupt platform sql queries blocks gui with DB Access Error
issue with latest github code

it is not possible to select test cases inside the test specification tree viewer or to filter the test specification tree viewer for a plattform.

instead the test case details or filters trees *DB Access Errors* are presented


1. platform filter
- Test Project Management - Create test project TP1
- Platform Management - Create platform _Plattfisch One_
- Test Specification
-- Filters - Platforms - Select _Plattfisch One_
-- Apply -> DB Access Error A

2. Create / Seelct test case
- Test Project Management - Create test project TP2
- Test Specification
-- Test Suite Operation - Create suite TS1
-- Test Case Operation - Create case TC1 -> DB Access Error B

test case TC1 was inserted, but can not be presented inside the Test Specification
- reopen Test Specification
-- tree list test suite TS01 and test case TC1
-- select in tree test case TC1 -> DB Access Error B


github commit state 32ed3cd79 Merge pull request 0000197

-----------------------
DB Access Error A
-------------------------
#0 database->exec_query(/* Filter Type = AND */
                SELECT FOXDOG.testcase_id
                FROM ( /* SQL COUNT */ SELECT COUNT(TPL.tcversion_id) AS HITS,
                             MAX(TPL.testcase_id) AS testcase_id,
                             TPL.tcversion_id
                      FROM platforms PL
                      JOIN testcase_platforms TPL
                      ON platform_id = PL.id
                      JOIN latest_tcase_version_id LTCV
                      ON LTCV.tcversion_id = TPL.tcversion_id
                      WHERE testproject_id = 1
                      AND platform_id IN (1)
                      GROUP BY tcversion_id ) AS FOXDOG
                WHERE FOXDOG.HITS=1, -1) called at [/usr/local/www/testlink-git/lib/functions/database.class.php:637]
#1 database->fetchRowsIntoMap(/* Filter Type = AND */
                SELECT FOXDOG.testcase_id
                FROM ( /* SQL COUNT */ SELECT COUNT(TPL.tcversion_id) AS HITS,
                             MAX(TPL.testcase_id) AS testcase_id,
                             TPL.tcversion_id
                      FROM platforms PL
                      JOIN testcase_platforms TPL
                      ON platform_id = PL.id
                      JOIN latest_tcase_version_id LTCV
                      ON LTCV.tcversion_id = TPL.tcversion_id
                      WHERE testproject_id = 1
                      AND platform_id IN (1)
                      GROUP BY tcversion_id ) AS FOXDOG
                WHERE FOXDOG.HITS=1, testcase_id) called at [/usr/local/www/testlink-git/lib/functions/testproject.class.php:4146]
0000002 testproject->getTCLatestVersionFilteredByPlatforms(1, Array ([0] => 1)) called at [/usr/local/www/testlink-git/lib/functions/treeMenu.inc.php:2551]

----------------------
DB Access Error B
----------------------

#0 database->exec_query( SELECT TCPL.id AS tcplat_link,platform_id,PL.name,PL.notes,
             testcase_id,tcversion_id
             FROM testcase_platforms TCPL
             JOIN platforms PL
             ON platform_id = PL.id WHERE testcase_id = 3 AND tcversion_id=4, -1) called at [/usr/local/www/testlink-git/lib/functions/database.class.php:637]
#1 database->fetchRowsIntoMap( SELECT TCPL.id AS tcplat_link,platform_id,PL.name,PL.notes,
             testcase_id,tcversion_id
             FROM testcase_platforms TCPL
             JOIN platforms PL
             ON platform_id = PL.id WHERE testcase_id = 3 AND tcversion_id=4, platform_id) called at [/usr/local/www/testlink-git/lib/functions/testcase.class.php:9520]
0000002 testcase->getPlatforms(3, 4) called at [/usr/local/www/testlink-git/lib/functions/testcase.class.php:1046]
No tags attached.
child of 0008549assigned fman Availables hot-fixes for 1.9.19 & How To get full fixed package from GitHub 
log db-access-error-A.log (71,488) 2019-06-14 20:35
http://mantis.testlink.org/file_download.php?file_id=5170&type=bug
log db-access-error-B.log (571,612) 2019-06-14 20:36
http://mantis.testlink.org/file_download.php?file_id=5171&type=bug
log db-access-error-C.log (646,922) 2019-06-14 20:36
http://mantis.testlink.org/file_download.php?file_id=5172&type=bug
Issue History
2019-06-13 19:13lczubNew Issue
2019-06-14 10:15fmanNote Added: 0028939
2019-06-14 20:35lczubFile Added: db-access-error-A.log
2019-06-14 20:36lczubFile Added: db-access-error-B.log
2019-06-14 20:36lczubFile Added: db-access-error-C.log
2019-06-14 20:39lczubNote Added: 0028945
2019-06-15 07:40fmanNote Added: 0028946
2019-06-15 18:11fmanNote Added: 0028947
2019-06-15 18:13fmanNote Added: 0028948
2019-06-15 18:20fmanNote Added: 0028949
2019-06-15 18:20fmanAssigned To => fman
2019-06-15 18:20fmanStatusnew => feedback
2019-06-15 18:22fmanRelationship addedchild of 0008549
2019-06-16 11:03lczubNote Added: 0028953
2019-06-16 11:03lczubStatusfeedback => assigned

Notes
(0028939)
fman   
2019-06-14 10:15   
would you mind to provide the text of the sql error you got?

thanks
(0028945)
lczub   
2019-06-14 20:39   
You find the full sql error text in the attachments db-access-error-[A|B|C].log

db-access-error-C.log shows a variation of db-access-error-b.log
(0028946)
fman   
2019-06-15 07:40   
thans
(0028947)
fman   
2019-06-15 18:11   
Missing tables

--
-- Table structure for table "testcase_platforms"
--
CREATE TABLE /*prefix*/testcase_platforms(
  "id" BIGSERIAL NOT NULL ,
  "testcase_id" BIGINT NOT NULL DEFAULT '0' REFERENCES /*prefix*/nodes_hierarchy (id),
  "tcversion_id" BIGINT NOT NULL DEFAULT '0' REFERENCES /*prefix*/tcversions (id),
  "platform_id" BIGINT NOT NULL DEFAULT '0' REFERENCES /*prefix*/platforms (id) ON DELETE CASCADE,
  PRIMARY KEY ("id")
);
CREATE UNIQUE INDEX /*prefix*/idx01_testcase_platforms ON /*prefix*/testcase_platforms ("testcase_id","tcversion_id","platform_id");
CREATE INDEX /*prefix*/idx02_testcase_platforms ON /*prefix*/testcase_platforms ("tcversion_id");
(0028948)
fman   
2019-06-15 18:13   
--
--
CREATE OR REPLACE VIEW /*prefix*/tcversions_without_platforms AS
(
  SELECT NHTCV.parent_id AS testcase_id, NHTCV.id AS id
  FROM /*prefix*/nodes_hierarchy NHTCV
  WHERE NHTCV.node_type_id = 4
  AND NOT(EXISTS(SELECT 1 FROM /*prefix*/testcase_platforms TCPL
                 WHERE TCPL.tcversion_id = NHTCV.id ) )
);
(0028949)
fman   
2019-06-15 18:20   
ALSO -
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/95e568abb0a46fe8aa4b320126da59a8084ae090 [^]
(0028953)
lczub   
2019-06-16 11:03   
Thanks, retest passet with github code - commit state 95e568abb

- sql installation on postgresql 9.6.12 - no errors occur
- view tcversions_without_platforms - is created
- table testplan_platforms - is created

- Gui - Test Specification - Filters - Apply - no error DB Access Error occur
- Gui - Test Specification - Select Test case - no error DB Access Error occur