Repository navigation
fix: backport SQL syntax/operator compatibility to 3.0-dev - #24196
Merged
11 commits merged intoApr 28, 2026
Merged
11 commits merged into
11 commits merged into
Conversation
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
LeftHandCold
requested review from
XuPeng-SH,
aunjgr,
iamlinjunhong and
ouyuanning
as code owners
April 24, 2026 07:21
There was a problem hiding this comment.
Pull request overview
Backports several MySQL-compatibility SQL surface features to 3.0-dev (JSON -> / ->>, null-safe equal <=>, and multi-table DROP TABLE) and fills in related correctness gaps (mixed numeric comparisons and JSON-to-numeric casting), with corresponding parser/binder/plan/execution wiring and tests.
Changes:
- Add parser + binder + function support for
<=>and JSON arrow operators->/->>. - Implement multi-table
DROP TABLEplanning/execution viaDropTable.tables, including FK/privilege handling updates. - Improve mixed numeric comparison fallback and JSON→numeric cast behavior; add distributed + unit test coverage.
Reviewed changes
Copilot reviewed 24 out of 26 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/distributed/cases/function/func_null_safe_equal.sql | Distributed SQL coverage for <=> operator behavior. |
| test/distributed/cases/function/func_null_safe_equal.result | Expected results for <=> distributed test. |
| test/distributed/cases/function/func_json_arrow.sql | Distributed SQL coverage for JSON -> / ->> operators. |
| test/distributed/cases/function/func_json_arrow.result | Expected results for JSON arrow distributed test. |
| test/distributed/cases/ddl/drop_table_multiple.sql | Distributed SQL coverage for multi-table DROP TABLE. |
| test/distributed/cases/ddl/drop_table_multiple.result | Expected results for multi-drop distributed test. |
| proto/plan.proto | Extend DropTable plan node to carry per-table entries for multi-drop. |
| pkg/sql/plan/function/list_operator.go | Register <=> operator and type-check/casting rules. |
| pkg/sql/plan/function/init.go | Add encoded ID/name constants for <=>. |
| pkg/sql/plan/function/function_id.go | Allocate a new function ID and register <=> operator name. |
| pkg/sql/plan/function/function_id_test.go | Update function ID map to include <=>. |
| pkg/sql/plan/function/func_compare.go | Implement runtime execution for <=> and update mismatch-compare callsites. |
| pkg/sql/plan/function/func_compare_fix.go | Rework numeric type-mismatch fallback to avoid cross-type precision loss. |
| pkg/sql/plan/function/func_compare_test.go | Add unit tests for mixed numeric compare and <=>. |
| pkg/sql/plan/function/func_cast.go | Enable JSON→numeric casts with overflow/precision handling. |
| pkg/sql/plan/function/func_cast_test.go | Add unit tests for JSON→integer precision/overflow. |
| pkg/sql/plan/deepcopy.go | Ensure DropTable deep copy covers multi-drop entries. |
| pkg/sql/plan/build_ddl.go | Build multi-table DROP TABLE plans + FK-target logic. |
| pkg/sql/plan/base_binder.go | Bind <=> comparisons (including tuple support). |
| pkg/sql/parsers/dialect/mysql/scanner.go | Lex ->> as a distinct token. |
| pkg/sql/parsers/dialect/mysql/mysql_sql.y | Parse -> / ->> and rewrite into JSON function calls. |
| pkg/sql/parsers/dialect/mysql/mysql_sql_test.go | Parser round-trip tests for JSON arrow operators. |
| pkg/sql/compile/ddl.go | Execute multi-drop by iterating per-table DropTable entries. |
| pkg/frontend/authenticate.go | Update privilege checking/implicit revokes for multi-table DROP TABLE. |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
ghost
approved these changes
Apr 24, 2026
iamlinjunhong
approved these changes
Apr 24, 2026
ouyuanning
approved these changes
Apr 24, 2026
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
aunjgr
approved these changes
Apr 27, 2026
Co-authored-by: Copilot <[email protected]>
This pull request was closed.
This branch was previously deployed
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.
What type of PR is this?
Which issue(s) this PR fixes:
fixes #24183
What this PR does / why we need it:
Backport SQL syntax/operator compatibility fixes to 3.0-dev for issue #24183.
This PR completes the 3.0-dev implementation of:
->and->><=>DROP TABLEDuring review, it also closes several correctness gaps needed to make the backport safe on 3.0-dev:
The change is implemented directly on 3.0-dev instead of cherry-picking the main branch patches verbatim, because this branch already had partial/incomplete wiring and diverges enough that a manual backport is lower risk.