From ecc00f873975e1e795eb42db9318d409ab4397b9 Mon Sep 17 00:00:00 2001 From: zio Date: Tue, 14 Jul 2026 02:02:31 +0900 Subject: [PATCH] fix(system): cast null-check params to ::text in SysMessageMapper (PG $2 type inference 500) PostgreSQL cannot infer the type of a bare bind in '(? IS NULL OR col = ?)', failing GET /api/admin/messages with BadSqlGrammarException. Cast the null-check occurrence to ::text (findAll category/locale, delete locale). Co-Authored-By: Claude Fable 5 --- .../com/zioinfo/kintex/system/message/SysMessageMapper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/src/main/java/com/zioinfo/kintex/system/message/SysMessageMapper.java b/src/backend/src/main/java/com/zioinfo/kintex/system/message/SysMessageMapper.java index 5fea5fe..c867af9 100644 --- a/src/backend/src/main/java/com/zioinfo/kintex/system/message/SysMessageMapper.java +++ b/src/backend/src/main/java/com/zioinfo/kintex/system/message/SysMessageMapper.java @@ -15,8 +15,8 @@ public interface SysMessageMapper { @Select("SELECT msg_code AS \"msgCode\", locale, category, title, template, use_yn AS \"useYn\", " + "to_char(updated_at,'YYYY-MM-DD\"T\"HH24:MI:SS') AS \"updatedAt\" FROM sys_message " + "WHERE tenant_id = #{tenantId} " - + "AND (#{category} IS NULL OR category = #{category}) " - + "AND (#{locale} IS NULL OR locale = #{locale}) " + + "AND (#{category}::text IS NULL OR category = #{category}) " + + "AND (#{locale}::text IS NULL OR locale = #{locale}) " + "ORDER BY category, msg_code, locale") List> findAll(@Param("tenantId") String tenantId, @Param("category") String category, @@ -45,7 +45,7 @@ public interface SysMessageMapper { int upsert(Map p); @Delete("DELETE FROM sys_message WHERE tenant_id = #{tenantId} AND msg_code = #{msgCode} " - + "AND (#{locale} IS NULL OR locale = #{locale})") + + "AND (#{locale}::text IS NULL OR locale = #{locale})") int delete(@Param("tenantId") String tenantId, @Param("msgCode") String msgCode, @Param("locale") String locale);