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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to