Fix new searchbuilder on oracle (#2205)

* Fix new searchbuilder on oracle

* Add changelog
This commit is contained in:
James Agnew 2020-12-02 06:22:41 -05:00 committed by GitHub
parent 18541d4388
commit 6e72ee8f6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View File

@ -0,0 +1,4 @@
---
type: fix
issue: 2205
title: "The new JPA SearchBuilder failed to perform FHIR Searches on Oracle DB with an invalid SQL error. This has been corrected."

View File

@ -355,11 +355,6 @@ public class SearchQueryBuilder {
maxResultsToFetch = defaultIfNull(maxResultsToFetch, 10000); maxResultsToFetch = defaultIfNull(maxResultsToFetch, 10000);
sql = "SELECT " +
myFirstPredicateBuilder.getResourceIdColumn().getColumnNameSQL() +
" FROM ( " + sql + " ) " +
" AS " + myFirstPredicateBuilder.getResourceIdColumn().getColumnNameSQL();
LimitHandler limitHandler = myDialect.getLimitHandler(); LimitHandler limitHandler = myDialect.getLimitHandler();
RowSelection selection = new RowSelection(); RowSelection selection = new RowSelection();
selection.setFirstRow(offset); selection.setFirstRow(offset);

View File

@ -3650,6 +3650,8 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
p2.addName().setFamily(methodName + "2"); p2.addName().setFamily(methodName + "2");
IIdType pid2 = myClient.create().resource(p2).execute().getId().toUnqualifiedVersionless(); IIdType pid2 = myClient.create().resource(p2).execute().getId().toUnqualifiedVersionless();
myCaptureQueriesListener.clear();
HttpGet get = new HttpGet(ourServerBase + "/Patient?_lastUpdated=lt" + new InstantType(new Date(time1)).getValueAsString()); HttpGet get = new HttpGet(ourServerBase + "/Patient?_lastUpdated=lt" + new InstantType(new Date(time1)).getValueAsString());
CloseableHttpResponse response = ourHttpClient.execute(get); CloseableHttpResponse response = ourHttpClient.execute(get);
try { try {
@ -3664,6 +3666,8 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
response.close(); response.close();
} }
myCaptureQueriesListener.logSelectQueries();
get = new HttpGet(ourServerBase + "/Patient?_lastUpdated=gt" + new InstantType(new Date(time1)).getValueAsString()); get = new HttpGet(ourServerBase + "/Patient?_lastUpdated=gt" + new InstantType(new Date(time1)).getValueAsString());
response = ourHttpClient.execute(get); response = ourHttpClient.execute(get);
try { try {