Repository navigation
fix(parser): gate executable comments by MySQL version - #31168
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
fengttt
left a comment
There was a problem hiding this comment.
This PR definitely needs BVT tests.
done |
63ebc06 to
e10d395
Compare
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: e10d395884b38901d660751d915b96a27d2d1526
Assessment: approve
Reviewed the complete 14-file delta and affected callers. Version gating belongs in the shared scanner; bounded numeric comparison avoids overflow without duplicating parsing or adding retained state. Error handling, cancellation, source spans and session-mode behavior remain coherent. No actionable defect remains. The earlier BVT request is resolved by the maintained SQL/result cases and supporting execution evidence.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Evidence retained under /home/xupeng/.local/state/mo-bot/jobs/41979fa9d962d18c19ae58f8/attempt-1. review-record.json maps commands, source fingerprints, exit receipts and logs; discussion-assessment.json accounts for all four nonempty discussion items.
-
Isolation preflight and fresh repository-owned native build passed. Verified 200 native inputs against the frozen source and seven output hashes.
-
Eleven focused tests passed, including scanner/parser boundaries, cancellation, work budgets and an independent 415-guard numeric oracle. Configuration and real frontend tests passed, covering both COM_QUERY rounds and connection recovery after errors.
-
Frozen current-head CI reports successful unit tests, static analysis and PROXY/PESSIMISTIC BVT. Reviewed the author’s reported exact-head frontend and two 20/20 BVT runs as supporting evidence.
-
Base-scanner overlay comparison: future-body scanning improved from 8.750 to 2.528 microseconds; eligible-comment scanning increased from 136.3 to 191.7 nanoseconds. Allocation counts and bytes were unchanged across measured paths.
-
Formatting, diff and final evidence audits passed; source remains unchanged. Final audit: audit-review.log and checks/1793076901717000806-4.json.
Limitations:
-
Linked issue text and raw author/CI logs were not supplied; local_validation was empty. The PR contains concrete reproductions, and local checks independently exercised the changed behavior.
-
Full BVT and race suites were not rerun locally.
-
Benchmarks measure scanner behavior on an unpinned host, not SQL throughput. Ordinary SELECT/INSERT/DDL medians were approximately 4%/12%/3% higher; short, noisy samples do not establish a causal regression or prove its absence.
|
Queued — the merge queue status continues in this comment ↓. |
🛑 Pull request from fork cannot be queuedDetailsThis pull request comes from a fork, and Mergify needs the author's permission to update its branch. |
|
@Mergifyio refresh |
✅ Pull request refreshed |
🚫 Left the queue38 min in the queue, with no time running CI. So far
Reason Pull request #31168 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
Hint You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Merge conditions not met when it left the queue
Tick the box to put this pull request back in the merge queue (same as
2 merge conditions met
Times in UTC · dashboard · how the merge queue works |
…29c01320554e43f6f404ec2f84ab71da77f2fb1
What type of PR is this?
Which issue(s) this PR fixes:
What this PR does / why we need it:
Future-version executable comments currently enter the SQL token stream unconditionally. For example,
/*!99999 SELECT 42 */executes, andSELECT 2 /*!999999999 */fails because leftover version digits become SQL.Compare the complete immediate ASCII digit run with the fixed MySQL compatibility baseline (80030), saturating the value to prevent overflow. Ignore future bodies through the first block-comment terminator, retaining complete comment spans and existing parser/split/continuation semantics. Share compatibility constants with the default handshake prefix. Matching, lower-version and unversioned comments continue to execute; 1–4 digit guards remain invalid.
Complete-run comparison is an intentional extension for nonstandard long guards, including leading zeros. Custom display prefixes do not change the SQL compatibility baseline; nested-comment support is unchanged. Scanning remains linear with constant extra numeric space and no new allocations or mutable global state.
Rebased onto official main
2465dae7a4ada1b277113cca5afff6fe10149b96to refresh CI after #31146 was closed with upstream CI/test corrections. Both original commits remain identical undergit range-diff; this refresh adds no product or test changes.Validation on rebased
e10d395884b38901d660751d915b96a27d2d1526, Darwin/arm64, Go 1.27.1, normal CGo with freshly built usearch 2.26.5/libmo:go test -mod=readonly -v -count=1 -timeout=300s -run '^TestRunSQLWithFrontend$' ./pkg/embedpasses, including its two rounds of COM_QUERY results, mode effects and error recovery.comment/executable_comment.sqlpasses normal mo-tester comparison twice on one owned ready instance (./run.sh -n -g -o -p <case>), 20/20 each, zero ignored/failed. Mode restoration and database teardown pass; SQL/result fixtures are unchanged. Standard-ndisables metadata comparison.go vet, configured incremental lint for the five changed Go packages (zero issues), formatting and diff checks pass./tmppaths; no unrestricted full-config-suite result is claimed.New-head CI is pending. The failed old run is not rerun. Issue verification remains with the reporter after merge.