Skip to content

Commit

Permalink
HHH-18739 - Fix for hints in queries containing joins
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Schatteman <[email protected]>
  • Loading branch information
jrenaat committed Oct 18, 2024
1 parent db24cf1 commit 75885b9
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ public class IndexQueryHintHandler implements QueryHintHandler {

public static final IndexQueryHintHandler INSTANCE = new IndexQueryHintHandler();

private static final Pattern QUERY_PATTERN = Pattern.compile( "^\\s*(select\\b.+?\\bfrom\\b.+?)(\\bwhere\\b.+?)$" );

private static final Pattern QUERY_PATTERN = Pattern.compile( "^\\s*(select\\b.+?\\bfrom\\b.+?)(\\b(where|join)\\b.+?)$" );
@Override
public String addQueryHints(String query, String hints) {
Matcher matcher = QUERY_PATTERN.matcher( query );
Expand Down

0 comments on commit 75885b9

Please sign in to comment.