Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008692TestLinkInternal issuepublic2019-06-13 19:132019-06-16 11:03
Reporterlczub 
Assigned Tofman 
PriorityhighSeveritycrashReproducibilityalways
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Fixed in Version 
Summary0008692: (github code) - corrupt platform sql queries blocks gui with DB Access Error
Descriptionissue 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


Steps To Reproduce1. 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


Additional Informationgithub 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]
TagsNo tags attached.
Database (MySQL,Postgres,etc)psql 9.6.12
Browser
PHP Version5
TestCaseID
QA Team - Task Workflow Status
Attached Fileslog file icon db-access-error-A.log [^] (71,488 bytes) 2019-06-14 20:35
log file icon db-access-error-B.log [^] (571,612 bytes) 2019-06-14 20:36
log file icon db-access-error-C.log [^] (646,922 bytes) 2019-06-14 20:36

- Relationships
child of 0008549assignedfman Availables hot-fixes for 1.9.19 & How To get full fixed package from GitHub 

-  Notes
(0028939)
fman (administrator)
2019-06-14 10:15

would you mind to provide the text of the sql error you got?

thanks
(0028945)
lczub (reporter)
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 (administrator)
2019-06-15 07:40

thans
(0028947)
fman (administrator)
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 (administrator)
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 (administrator)
2019-06-15 18:20

ALSO -
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/95e568abb0a46fe8aa4b320126da59a8084ae090 [^]
(0028953)
lczub (reporter)
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

- Issue History
Date Modified Username Field Change
2019-06-13 19:13 lczub New Issue
2019-06-14 10:15 fman Note Added: 0028939
2019-06-14 20:35 lczub File Added: db-access-error-A.log
2019-06-14 20:36 lczub File Added: db-access-error-B.log
2019-06-14 20:36 lczub File Added: db-access-error-C.log
2019-06-14 20:39 lczub Note Added: 0028945
2019-06-15 07:40 fman Note Added: 0028946
2019-06-15 18:11 fman Note Added: 0028947
2019-06-15 18:13 fman Note Added: 0028948
2019-06-15 18:20 fman Note Added: 0028949
2019-06-15 18:20 fman Assigned To => fman
2019-06-15 18:20 fman Status new => feedback
2019-06-15 18:22 fman Relationship added child of 0008549
2019-06-16 11:03 lczub Note Added: 0028953
2019-06-16 11:03 lczub Status feedback => assigned



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker