Oracle8iDialect should use CASE_INSENSITIVE pattern matching when checking the statement type

Description

When running native SQL query like this one:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 entityManager .createNativeQuery( "SELECT " + " p.id " + "FROM " + " post p " + "WHERE EXISTS ( " + " SELECT 1 " + " FROM " + " post_comment pc " + " WHERE " + " pc.post_id = p.id AND " + " pc.review = 'Bingo' " + ") " + "ORDER BY " + " p.title " + "OFFSET 20 ROWS " + "FETCH NEXT 10 ROWS ONLY") .unwrap(org.hibernate.query.Query.class) .addQueryHint("GATHER_PLAN_STATISTICS") .setComment("POST_WITH_BINGO_COMMENTS") .getResultList();

Hibernate throws:

1 java.lang.IllegalArgumentException: Can't determine SQL statement type for statement: SELECT p.id FROM post p WHERE EXISTS ( SELECT 1 FROM post_comment pc WHERE pc.post_id = p.id AND pc.review = 'Bingo' ) ORDER BY p.title OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY

This is because the statement type is matched using a case sensitive pattern matcher.

Environment

None

Status

Assignee

Unassigned

Reporter

Vlad Mihalcea

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.4.4

Priority

Major