You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by "Aias00 (via GitHub)" <gi...@apache.org> on 2026/08/04 02:56:46 UTC

[I] [BUG] operation_record_log BaseResultMap has duplicate conflicting id mappings (VARCHAR + BIGINT) [shenyu]

Aias00 opened a new issue, #6868:
URL: https://github.com/apache/shenyu/issues/6868

   ## Description
   `onResourcesCreated(BatchResourceDeletedEvent)` (line 165) calls `permissionMapper.deleteByResourceId(event.getDeletedIds())` and `onRoleDeleted` (line 174) calls `permissionMapper.deleteByObjectIds(event.getDeletedIds())` with no `CollectionUtils.isNotEmpty` guard. The mapper XMLs emit `WHERE resource_id IN <foreach open="(" close=")">` with no empty-collection guard, so an empty `deletedIds` renders `WHERE resource_id IN ()` → SQL syntax error. Other call sites in this service (e.g. `manageRolePermission`) guard with `CollectionUtils.isNotEmpty`. Also: the method at line 165 is named `onResourcesCreated` but handles `BatchResourceDeletedEvent` — a copy-paste naming defect.
   
   ## Location
   - `shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/PermissionServiceImpl.java:165-167,174-177`
   - `shenyu-admin/src/main/resources/mappers/permission-sqlmap.xml:134-145`
   
   ## Impact
   A batch delete/select event with zero ids throws an unhandled SQL exception inside the event listener (logs a warning/stack trace; permission cleanup for that event is skipped).
   
   ## Suggested fix
   Guard each handler: `if (CollectionUtils.isNotEmpty(event.getDeletedIds())) { permissionMapper.deleteByResourceId(event.getDeletedIds()); }`. Rename the line-165 method to `onResourcesDeleted`.
   
   ## Related existing
   Distinct from N18 (#6687, RegistryController/NamespaceController empty `IN()`) — these are event-listener call sites in `PermissionServiceImpl`, a different class and trigger path.
   


-- 
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: notifications-unsubscribe@shenyu.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] operation_record_log BaseResultMap has duplicate conflicting id mappings (VARCHAR + BIGINT) [shenyu]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6868:
URL: https://github.com/apache/shenyu/issues/6868#issuecomment-5174075842

   👋 Hello @yuluo-yx
   
   A new issue has been opened by @Aias00:
   - **Title**: [BUG] operation_record_log BaseResultMap has duplicate conflicting id mappings (VARCHAR + BIGINT)
   - **Link**: https://github.com/apache/shenyu/issues/6868
   
   Please review when you have time. Thank you! 🙏


-- 
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: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] operation_record_log BaseResultMap has duplicate conflicting id mappings (VARCHAR + BIGINT) [shenyu]

Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 closed issue #6868: [BUG] operation_record_log BaseResultMap has duplicate conflicting id mappings (VARCHAR + BIGINT)
URL: https://github.com/apache/shenyu/issues/6868


-- 
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: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org