Skip to content

Conversation

@baiyutang
Copy link

@baiyutang baiyutang commented Feb 2, 2026

What type of PR is this?

fix:

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Add documentation if the current PR requires user awareness at the usage level.

(Optional) Translate the PR title into Chinese.

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en: db query error when the node execute with a order field.
zh(optional): 数据库查询指定排序时可能会报错

(Optional) Which issue(s) this PR fixes:

@CLAassistant
Copy link

CLAassistant commented Feb 2, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a database query error that occurs when specifying an order field using a field ID instead of a field name. The issue arose because the order field mapping logic only checked for field names in the fieldNameToPhysical map but didn't handle field IDs.

Changes:

  • Added fallback logic to map order field IDs to their physical names when the field is not found in fieldNameToPhysical

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if mapped, exists := fieldNameToPhysical[order.Field]; exists {
physicalField = mapped
} else {
// AlterID
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment "AlterID" is vague and doesn't clearly explain the purpose of this else clause. Consider a more descriptive comment such as "Check if order.Field is a field ID (AlterID as string) instead of a field name" to clarify that this handles the case where the field is identified by its ID rather than its name.

Suggested change
// AlterID
// Check if order.Field is a field ID (AlterID as string) instead of a field name

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants