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:47:58 UTC
[I] [BUG] tag_relation updateByPrimaryKeySelective sets non-existent name column instead of api_id [shenyu]
Aias00 opened a new issue, #6830:
URL: https://github.com/apache/shenyu/issues/6830
## Description
`tag_relation updateByPrimaryKeySelective` contains `<if test="apiId != null"> name = #{apiId, jdbcType=VARCHAR}, </if>`. The `tag_relation` table has columns `id, api_id, tag_id, date_created, date_updated` — there is **no `name` column**. When `apiId` is non-null, the generated SQL is `UPDATE tag_relation SET name = ? ...` → `Unknown column 'name'` SQL error. Reachable: `TagRelationServiceImpl.update()` calls `tagRelationMapper.updateByPrimaryKeySelective(tagRelationDO)`, and `TagRelationDO.buildTagRelationDO` populates `apiId` from the DTO.
## Location
- `shenyu-admin/src/main/resources/mappers/tag-relation-sqlmap.xml:125`
- `shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/TagRelationServiceImpl.java:54`
## Impact
Updating a tag-relation whose `apiId` is set throws a runtime SQL exception (HTTP 500) rather than performing the update; the tag-relation edit path is broken whenever apiId is supplied.
## Suggested fix
Change line 125 to `api_id = #{apiId, jdbcType=VARCHAR},`.
## Related existing
Distinct from N23 (#6692, `TagServiceImpl.delete` no cascade) and N55 (TagDTO validation). This is a wrong-column SQL defect in `tag-relation-sqlmap`.
--
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] tag_relation updateByPrimaryKeySelective sets non-existent name column instead of api_id [shenyu]
Posted by "yangjj-iso (via GitHub)" <gi...@apache.org>.
yangjj-iso commented on issue #6830:
URL: https://github.com/apache/shenyu/issues/6830#issuecomment-5267363191
I have opened #6907 for this.
I confirmed the reachability while working on it: `PUT /tag-relation/id/{id}` reaches `TagRelationController.updateTagRelation`, which calls `TagRelationServiceImpl.update`, and `TagRelationDO.buildTagRelationDO` always populates `apiId` from the DTO. So the `<if test="apiId != null">` branch fires on any update whose body carries an `apiId`, and the statement fails with `Column "NAME" not found` rather than performing the update.
The PR changes `name` to `api_id` and adds a `testUpdateByPrimaryKeySelective` case to `TagRelationMapperTest`. That happened to be the only `TagRelationMapper` method the test class did not cover, which is probably why this went unnoticed. I also verified the new test fails with `BadSqlGrammar` when the mapper change is reverted, so it genuinely pins the defect.
--
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] tag_relation updateByPrimaryKeySelective sets non-existent name column instead of api_id [shenyu]
Posted by "dengliming (via GitHub)" <gi...@apache.org>.
dengliming closed issue #6830: [BUG] tag_relation updateByPrimaryKeySelective sets non-existent name column instead of api_id
URL: https://github.com/apache/shenyu/issues/6830
--
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] tag_relation updateByPrimaryKeySelective sets non-existent name column instead of api_id [shenyu]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6830:
URL: https://github.com/apache/shenyu/issues/6830#issuecomment-5174025588
👋 Hello @yuluo-yx
A new issue has been opened by @Aias00:
- **Title**: [BUG] tag_relation updateByPrimaryKeySelective sets non-existent name column instead of api_id
- **Link**: https://github.com/apache/shenyu/issues/6830
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