Skip to content

Commit

Permalink
Add a space in front of the hint and use brackets around the name of …
Browse files Browse the repository at this point in the history
…the index to prevent SQL errors.

Fixes: SIRI-947
  • Loading branch information
oolscireum committed Apr 24, 2024
1 parent 00f41c2 commit bc68142
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/sirius/db/jdbc/SmartQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public <T extends SQLEntity> SmartQuery<E> ignoreIndex(Class<T> table, String fo
*/
private <T extends SQLEntity> void indexHint(Class<T> table, String type, String forHint, String indexName) {
indexHints.put(mixing.getDescriptor(table).getRelationName(),
type + " INDEX " + (forHint != null ? forHint + " " : "") + indexName);
" " + type + " INDEX (" + (forHint != null ? forHint + " " : "") + indexName + ")");
}

@Override
Expand Down

0 comments on commit bc68142

Please sign in to comment.