Aias00 opened a new issue, #6871:
URL: https://github.com/apache/shenyu/issues/6871
## Description
`insert`/`insertSelective` declare `<selectKey keyProperty="id"
order="AFTER" resultType="java.lang.String"> SELECT LAST_INSERT_ID()
</selectKey>`, but `scale_history.id` is `varchar(128) NOT NULL` (a
manually-assigned PK, not auto-increment), and `id` is omitted from the insert
column list. On MySQL strict mode the INSERT fails (no default for a NOT NULL
varchar); even if it ran, `LAST_INSERT_ID()` returns 0 for a non-auto-increment
insert → the DO's id is set to `"0"`. No `ScaleHistoryServiceImpl`/caller
exists, so latent.
## Location
-
`shenyu-admin/src/main/resources/mappers/scale-history-sqlmap.xml:57-59,68-70`
## Impact
Latent — any future caller of `scaleHistoryMapper.insert` will either fail
the insert or receive a bogus id "0".
## Suggested fix
Remove the `<selectKey>` blocks and add `id` to the column list, binding
`#{id, jdbcType=VARCHAR}` (let the service generate a UUID via `UUIDUtils`),
consistent with other varchar-PK mappers.
## Related existing
None — `scale_history` mapper was not in the filed list.
--
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]