-
Notifications
You must be signed in to change notification settings - Fork 377
Open
Labels
status: ideal-for-contributionAn issue that a contributor can help us withAn issue that a contributor can help us withtype: bugA general bugA general bug
Description
Escaper escaper = Escaper.DEFAULT;
String escaped = escaper.escape("a\\b%c");
will produce a string a\b\%c, where "%" is escaped but escape character itself is not escaped.
It leads to repository methods: "...StartsWith...", "...EndsWith...", "...Contains..." to return invalid results if search value contains escape character.
For the table:
| id | title |
|---|---|
| 1 | ab%cdef |
| 2 | a\b%cdef |
running:
repository.findAllByTitleStartsWith("a\\b%c")
will generate:
Executing prepared SQL statement [... WHERE "entity"."title" LIKE ?]
Setting SQL statement parameter value: column index 1, parameter value [a\b\%c%], value class [java.lang.String], SQL type 12
and will return
| id | title |
|---|---|
| 1 | ab%cdef |
Instead of:
| id | title |
|---|---|
| 2 | a\b%cdef |
which is returned by the query ... WHERE "entity"."title" LIKE 'a\\b\%c%'
Metadata
Metadata
Assignees
Labels
status: ideal-for-contributionAn issue that a contributor can help us withAn issue that a contributor can help us withtype: bugA general bugA general bug