fix(posts): findFeedWithAuthor SELECT p.* 修复 content_md 列缺失#37
Merged
Conversation
#36 的 JOIN SQL 只 SELECT 了部分列,rowMapper 读 content_md 时 PSQLException: column not found。改 SELECT p.* 保留全列, author_* 别名列追加在后,rowMapper 正常工作。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
#36 引入的
findFeedWithAuthorJOIN SQL 只 SELECT 了部分列,漏写了p.content_md(以及其他列),导致通用rowMapper读取content_md时抛出:生产
GET /api/posts/feed返回 500。修复
将 JOIN SQL 的部分列枚举改为
p.*,再追加 3 个作者别名列:rowMapper所需全列均可正常读取,作者别名列不与 posts 列冲突。