fix(posts): PostgreSQL untyped NULL 파라미터 500 + category_id UPDATE 누락
listPublishedKeyset SQL에서 #{categoryId}/#{cursorCreatedAt} IS NULL 조건 사용 시
PostgreSQL이 바인드 파라미터 타입을 결정하지 못해
PSQLException: could not determine data type of parameter $1 → 500 발생.
파라미터에 ::bigint / ::timestamptz 명시 캐스트 추가로 수정.
update() SQL에서 category_id = #{categoryId} 컬럼 누락 — 카테고리 변경이
DB에 반영되지 않는 데이터 정합성 버그 함께 수정.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3FeMrbtxfTScjrwUukyHD
This commit is contained in:
parent
8a3eea54ce
commit
168671bc14
|
|
@ -41,10 +41,10 @@ public interface PostsMapper {
|
|||
JOIN post_categories c ON c.id = p.category_id
|
||||
WHERE p.status = 'PUBLISHED'
|
||||
AND p.is_delete = false
|
||||
AND (#{categoryId} IS NULL OR p.category_id = #{categoryId})
|
||||
AND (#{categoryId}::bigint IS NULL OR p.category_id = #{categoryId}::bigint)
|
||||
AND (
|
||||
#{cursorCreatedAt} IS NULL
|
||||
OR (p.created_at, p.id) < (#{cursorCreatedAt}, #{cursorId})
|
||||
#{cursorCreatedAt}::timestamptz IS NULL
|
||||
OR (p.created_at, p.id) < (#{cursorCreatedAt}::timestamptz, #{cursorId}::bigint)
|
||||
)
|
||||
ORDER BY p.created_at DESC, p.id DESC
|
||||
LIMIT #{limit}
|
||||
|
|
@ -119,7 +119,8 @@ public interface PostsMapper {
|
|||
|
||||
@Update("""
|
||||
UPDATE posts
|
||||
SET title = #{title},
|
||||
SET category_id = #{categoryId},
|
||||
title = #{title},
|
||||
body_markdown = #{bodyMarkdown},
|
||||
body_sanitized_html = #{bodySanitizedHtml},
|
||||
link_url = #{linkUrl},
|
||||
|
|
|
|||
Loading…
Reference in New Issue