HHH-18739 - Fix for hints in queries containing joins

Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
Jan Schatteman 2024-10-18 21:23:33 +02:00 committed by Jan Schatteman
parent db24cf11c5
commit 75885b9dd1
1 changed files with 1 additions and 2 deletions

View File

@ -25,8 +25,7 @@ public class IndexQueryHintHandler implements QueryHintHandler {
public static final IndexQueryHintHandler INSTANCE = new IndexQueryHintHandler(); 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 @Override
public String addQueryHints(String query, String hints) { public String addQueryHints(String query, String hints) {
Matcher matcher = QUERY_PATTERN.matcher( query ); Matcher matcher = QUERY_PATTERN.matcher( query );