konlue opened a new pull request, #7754:
URL: https://github.com/apache/shenyu/pull/7754

   Fixes #7724.
   
   ## Summary
   
   `InstanceInfoMapper.selectOneByQuery` has no Oracle-specific mapping: the 
shared statement ends with `LIMIT 1`, which Oracle rejects. 
`InstanceInfoServiceImpl#createOrUpdate` calls this lookup before every 
insert/update, so instance identity persistence cannot work on an Oracle 
deployment.
   
   The same mapper already demonstrates the supported pattern in its `existed` 
statement (`databaseId="oracle"` + `ROWNUM = 1`).
   
   ## Modifications
   
   - Add a `databaseId="oracle"` variant of `selectOneByQuery` that keeps every 
identity/namespace predicate and ends with `AND ROWNUM = 1`.
   - Add a statement-shape regression test that parses the mapper with 
`databaseId="oracle"` and checks the resolved SQL.
   
   ## Verifying this change
   
   - [x] New `InstanceInfoMapperOracleSqlTest`: with `databaseId="oracle"`, 
`selectOneByQuery` resolves to SQL containing `ROWNUM` and no `LIMIT`, with all 
four filters (`instance_ip`, `namespace_id`, `instance_port`, `instance_type`) 
intact.
   - [x] Red-green: without the Oracle variant the test fails and reports the 
generic `... limit 1` statement; with it the test passes.
   - [x] Targeted tests pass:
   
     ```bash
     ./mvnw -B -ntp -pl shenyu-admin test -Dtest=InstanceInfoMapperOracleSqlTest
     ```
     1/1 green.
   
   - [x] Checkstyle passes:
   
     ```bash
     ./mvnw -B -ntp -pl shenyu-admin checkstyle:check
     ```
     clean.
   
   ## Notes
   
   `AND ROWNUM = 1` applies after the filters and preserves the single-row 
semantics of `LIMIT 1`. The test pins MyBatis dialect selection locally; 
execution against a real Oracle instance is exercised by the repository's SQL 
matrix.


-- 
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]

Reply via email to