konlue opened a new pull request, #7756:
URL: https://github.com/apache/shenyu/pull/7756
Fixes #7738.
## Summary
Operation-log keyword/exclusion searches are generated by the shared
`selectByCondition` statement with a three-argument `concat('%', #{...}, '%')`.
Oracle only supports two-argument `CONCAT`, so filtered searches fail on Oracle
deployments.
## Modifications
- Rewrite both predicates as nested two-argument calls: `concat(concat('%',
#{...}), '%')`, for `condition.keyword` and `condition.excluded`.
- Add a MyBatis statement-shape test resolved with `databaseId="oracle"`.
## Verifying this change
- [x] New `OperationRecordLogConcatSqlTest`: parses the mapper under
`databaseId="oracle"` with non-empty keyword/excluded and asserts the SQL uses
the nested two-argument form and never the three-argument form. Fails on the
previous statement (`concat('%',?,'%')`), passes with the fix.
- [x] Targeted test passes:
```bash
./mvnw -B -ntp -pl shenyu-admin test -Dtest=OperationRecordLogConcatSqlTest
```
1/1 green.
- [x] H2 functional regression passes:
```bash
./mvnw -B -ntp -pl shenyu-admin test -Dtest=OperationRecordLogMapperTest
```
2/2 green.
- [x] Checkstyle passes:
```bash
./mvnw -B -ntp -pl shenyu-admin checkstyle:check
```
clean.
## Notes
Only the expression nesting changes; wildcard placement and `LIKE`/`NOT
LIKE` semantics stay identical on every dialect. Nested `CONCAT` is supported
by Oracle, MySQL, PostgreSQL and H2 alike, so no dialect-specific statement is
needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]