Details
-
Bug
-
Status: Closed (View Workflow)
-
P2
-
Resolution: Done
-
29.3.0, 32.2.0
-
CP: sprint 112
-
3
-
Core: Platform
-
R1 2021 Bug Fix
Description
When this foreign key entry in schema.json is used:
{ "fieldName": "copyrightTracking.copyrightStatusId", "tableAlias": "copyrightStatus", "targetTable": "coursereserves_copyrightstates", "targetTableAlias": "copyrightStatus", "tOps": "ADD" }
And you run this CQL query: copyrightStatus.name==cc
Then you get this error:
query with count: ErrorMessage(fields=[(Severity, ERROR), (V, ERROR), (SQLSTATE, 42P01), (Message, missing FROM-clause entry for table "copyrighttracking"), (Where, PL/pgSQL function count_estimate_default(text) line 2 at EXECUTE ), (p, 146), (Internal Query, SELECT COUNT(*) FROM (SELECT * FROM diku_mod_courses.coursereserves_reserves WHERE (courseListingId='08b782b1-9792-42d3-97c9-e21ba59be085') AND (coursereserves_reserves.copyrightTracking.copyrightStatusId IN ( SELECT id FROM coursereserves_copyrightstates WHERE lower(f_unaccent(coursereserves_copyrightstates.jsonb->>'name')) LIKE lower(f_unaccent('cc')))) LIMIT 1000) x)
coursereserves_reserves.copyrightTracking.copyrightStatusId should be
coursereserves_reserves.copyrightTracking_copyrightStatusId
RMB needs to replace . by _ in the fieldName when generating SQL.
Reported by kurt with example in https://github.com/folio-org/mod-courses/commit/dcb0dd914dc17bcf00b66f57ddcb0c989feae2ec
TestRail: Results
Attachments
Issue Links
- blocks
-
MODCR-57 Copyright filter in Courses App --> Reserves pane returns error message when value selected
-
- Closed
-
-
RMB-825 Release RMB 32.2.1
-
- Closed
-
- is cloned by
-
RMB-830 foreign key non-alias sub-field query causes "missing FROM-clause" error
-
- Closed
-
- is duplicated by
-
RMB-585 Invalid SQL generated for coursereserves module
-
- Closed
-