-
Bug
-
Resolution: Fixed
-
Low
-
9.4.4, 9.13.1
-
9.04
-
1
-
Severity 3 - Minor
-
Issue Summary
There looks to be a bug in Portfolio's DefaultSchemaProvider since 2016. It tries to map table names to schemas, according to the current DB contents (not config). It was never ready for a situation where a table name is duplicated across schemas. In such a case, the last schema on the list wins. The list is ordered however the SQL server sees fit.
We can list duplicate tables:
SELECT TABLE_NAME, COUNT(*) AS TABLE_NAME_COUNT
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE='BASE TABLE'
GROUP BY TABLE_NAME
HAVING COUNT(*) > 1;
Steps to Reproduce
- Prepare an instance with the default DB schema: 'dbo'
- Duplicate the tables, copying them from 'dbo' to another schema, e.g. named 'jiraschema' (they can be empty)
- Configure Portfolio to use "blocked by" issue links
- Link two issues with "blocked by"
- Add the two issues to a Portfolio plan
- Open the Dependency Report
Expected Results
The two linked issues are visible in the Dependency Report.
Actual Results
The Dependency Report does not contain the issues.
Jira core sees issuelinks:
EE: SELECT ID, LINKTYPE, SOURCE, DESTINATION, SEQUENCE FROM dbo.issuelink WHERE DESTINATION=? [DESTINATION=1161560] EE: results 1 EE: SELECT ID, LINKTYPE, SOURCE, DESTINATION, SEQUENCE FROM dbo.issuelink WHERE SOURCE=? [SOURCE=1161560] EE: results 0 EE: SELECT ID, LINKTYPE, SOURCE, DESTINATION, SEQUENCE FROM dbo.issuelink WHERE DESTINATION=? [DESTINATION=1161561] EE: results 0
ARJ doesn't see issuelinks:
QD: select "link"."SOURCE", "link"."DESTINATION", "link"."LINKTYPE", "link"."ID" from "jiraschema"."issuelink" "link" where ("link"."LINKTYPE" in (?, ?)) and ("link"."SOURCE" in (?, ?) or ("link"."DESTINATION" in (?, ?))) [10240, 10540, 1161561, 1161560, 1161561, 1161560] QD: results 0 QD: select "link"."SOURCE", "link"."DESTINATION", "link"."LINKTYPE", "link"."ID" from "jiraschema"."issuelink" "link" where ("link"."LINKTYPE" in (?, ?)) and ("link"."SOURCE" in (?, ?) or ("link"."DESTINATION" in (?, ?))) [10240, 10540, 1161561, 1161560, 1161561, 1161560] QD: results 0
The params and column names match. The query logic is equivalent. But the DB schema is different: dbo vs jiraschema.
SELECT COUNT(*) FROM dbo.issuelink; > 3202
SELECT COUNT(*) FROM jiraschema.issuelink; > 1573
Workaround
Use Jira XML export. Import it on an instance without duplicated tables.
- mentioned in
-
Page Loading...