Skip to content

Cherry pick: rename table & null/negative limit and offset - #24557

Closed
daviszhen wants to merge 3 commits into
matrixorigin:3.0-devfrom
daviszhen:cherry-pick-compat
Closed

Cherry pick: rename table & null/negative limit and offset#24557
daviszhen wants to merge 3 commits into
matrixorigin:3.0-devfrom
daviszhen:cherry-pick-compat

Conversation

@daviszhen

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #24481

What this PR does / why we need it:

[cherry-pick] fix: support LIMIT 0 and improve error messages for NULL/negative LIMIT/OFFSET (#24455)
[cherry-pick] fix(plan): support MySQL-compatible chained RENAME TABLE (#24470)

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Blocking issue in pkg/sql/plan/build_ddl.go:

oldName was changed from tableDef.Name to the raw parsed tableName. That breaks rename correctness when the input spelling differs from the catalog name (for example with lower_case_table_names=1 / case-insensitive resolution):

  • the execution path requires rename.OldName == schema.Name (pkg/vm/engine/tae/catalog/schema.go), so a mixed-case input can now fail with unmatched old schema name
  • getSqlForRenameTable() also updates FK metadata by exact table_name, so using the raw SQL spelling can miss those rows

The old implementation used the catalog name, which matches both paths. We still need the remapped source name for chained hops, but this PR currently applies the raw SQL name to every hop.

@daviszhen

Copy link
Copy Markdown
Contributor Author

不再向3.0迁移更多的特性

@daviszhen daviszhen closed this Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/wip kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants