Skip to content

fix: escape Oracle NoSQL regex literals#374

Merged
otaviojava merged 2 commits into
eclipse-jnosql:1.1.xfrom
robertpatrick:fix/oracle-nosql-like-sql-literal-escaping-1.1.x
May 11, 2026
Merged

fix: escape Oracle NoSQL regex literals#374
otaviojava merged 2 commits into
eclipse-jnosql:1.1.xfrom
robertpatrick:fix/oracle-nosql-like-sql-literal-escaping-1.1.x

Conversation

@robertpatrick
Copy link
Copy Markdown
Contributor

Summary

Fix Oracle NoSQL regex_like query generation for LIKE-style predicates when the search value contains regex metacharacters.

Oracle NoSQL SQL string literals require regex escape backslashes to be escaped as well. Previously values such as a.c generated a\.c, which Oracle NoSQL rejects with:

PREPARE: Illegal Argument: Error: Illegal escape sequence: '\.'

This change emits doubled backslashes, e.g. a\.c, so the SQL literal is accepted and the regex engine receives the intended escaped metacharacter.

Changes

  • Escape regex metacharacters with doubled backslashes for Oracle NoSQL SQL string literals.
  • Apply the same escaping behavior to LIKE, contains, startsWith, and endsWith conversion helpers.
  • Update OracleNoSqlLikeConverterTest expectations to cover SQL-literal-safe escaping.

Validation

mvn -pl jnosql-oracle-nosql -Dtest=OracleNoSqlLikeConverterTest test

Result: 29 tests passed, 0 failures.

@robertpatrick
Copy link
Copy Markdown
Contributor Author

This PR depends on the changes in #372 for the CI build fix.

@robertpatrick
Copy link
Copy Markdown
Contributor Author

@otaviojava Now that #372 is merged, rerunning the CI should succeed. Do I need to make a phony update to this PR or can you reinitiate the CI builds?

@otaviojava otaviojava merged commit 60e3d54 into eclipse-jnosql:1.1.x May 11, 2026
3 checks passed
@otaviojava
Copy link
Copy Markdown
Contributor

Hey again, thanks, and I already merged it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants