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.
Description
tag_relation updateByPrimaryKeySelectivecontains<if test="apiId != null"> name = #{apiId, jdbcType=VARCHAR}, </if>. Thetag_relationtable has columnsid, api_id, tag_id, date_created, date_updated— there is nonamecolumn. WhenapiIdis non-null, the generated SQL isUPDATE tag_relation SET name = ? ...→Unknown column 'name'SQL error. Reachable:TagRelationServiceImpl.update()callstagRelationMapper.updateByPrimaryKeySelective(tagRelationDO), andTagRelationDO.buildTagRelationDOpopulatesapiIdfrom the DTO.Location
shenyu-admin/src/main/resources/mappers/tag-relation-sqlmap.xml:125shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/TagRelationServiceImpl.java:54Impact
Updating a tag-relation whose
apiIdis 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.deleteno cascade) and N55 (TagDTO validation). This is a wrong-column SQL defect intag-relation-sqlmap.