Skip to content

fix(parser): reject NULLS FIRST/LAST in MySQL syntax - #26236

Merged
mergify[bot] merged 10 commits into
matrixorigin:mainfrom
jiangxinmeng1:agent/fix-25332-order-by-nulls
Jul 28, 2026
Merged

mergify[bot] merged 10 commits into
matrixorigin:mainfrom
jiangxinmeng1:agent/fix-25332-order-by-nulls

Conversation

@jiangxinmeng1

@jiangxinmeng1 jiangxinmeng1 commented Jul 27, 2026 •

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 #25332 #26243

What this PR does / why we need it:

fix(parser): reject NULLS FIRST/LAST in MySQL syntax

@jiangxinmeng1
jiangxinmeng1 requested a review from a user July 27, 2026 08:41
@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.

Reviewed exact head 32559c268c211444833adb3de7e6bd7cd5e886ee against current main@159742db6672ff5dadb617880b831da026f0a3f4 and its auto-merge result.

[P2] Make the startup-failure cleanup actually close partially started services.

The new t.Cleanup(c.Close) is registered before c.Start(), but it cannot provide the guarantee stated by this commit. cluster.Close() iterates services in reverse and returns on the first operator.Close() error. In the HAKeeper-timeout path being fixed, LOG has started, TN fails while waiting for HAKeeper, and CN has never started. Cleanup therefore reaches the stopped CN first, gets service already stopped, returns immediately, and leaves the started LOG plus the partially initialized TN stopper/goroutines alive. It also adds a second cleanup assertion failure that obscures the original timeout and can contaminate TestPreparedParams in the same test binary.

Please make embedded-cluster startup roll back/close every service that was started or partially initialized, continuing past never-started services, and cover the LOG-started/TN-timeout/CN-not-started sequence with a focused failure-path test. Merely ignoring the Close error would retain the leak. If startup rollback is intentionally out of scope, register cleanup only after a successful Start and remove the claim that startup failures are cleaned, but that leaves the cleanup requirement from #26299 unresolved.

The parser portion otherwise looks correct: the BVT/doc rewrites preserve MySQL default NULL ordering, the merged generated parser reproduces byte-for-byte from mysql_sql.y, and no live repository SQL still uses the rejected syntax. Verification on the current-main merge result passed: parser focused race x100, parser package race, txnexecutor focused race x2, txnexecutor package race, and embed package race.

@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.

Deep-reviewed latest exact head 5fe9b097af9f5ae6ba532f85fc5e569b18837816. The previous documentation, duplicate allocation-test, and unrelated HAKeeper changes are all resolved/reverted. The grammar now rejects NULLS FIRST/LAST consistently in top-level and window ORDER BY while preserving valid MySQL ordering; BVT rewrites are semantically equivalent for ASC/DESC NULL placement, and no live user-facing SQL still advertises the rejected syntax. Generated mysql_sql.go matches mysql_sql.y, focused parser race passed for 20 iterations, and latest-main merge is clean. No production-path performance change. No blocker found.

@mergify mergify Bot added the queued label Jul 28, 2026
@mergify

mergify Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-07-28 13:32 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-07-28 15:49 UTC · at 9de954165ec456c501fd4b98571fda7596203f60 · squash

This pull request spent 2 hours 16 minutes 50 seconds in the queue, including 38 minutes 41 seconds running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / SCA Test on Linux/arm64
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants