Repository navigation
fix: restore load data pre-lock path - #24226
Merged
mergify[bot] merged 1 commit intoApr 27, 2026
Merged
mergify[bot] merged 1 commit into
mergify[bot] merged 1 commit into
Conversation
LeftHandCold
requested review from
XuPeng-SH,
aunjgr,
iamlinjunhong and
ouyuanning
as code owners
April 27, 2026 08:42
There was a problem hiding this comment.
Pull request overview
Restores pre-pipeline table locking for LOAD DATA (while keeping the narrowed lock window behavior for regular INSERT) and adds/updates several SQL planner/parser features and related tests.
Changes:
- Restore pre-pipeline table locking for
LOAD DATAplanned asQuery_INSERTwithLoadTag, and add a compile test to lock in the routing behavior. - Add MySQL operators/features: NULL-safe equality (
<=>) and JSON->/->>operators, plus JSON→numeric casting support and comparison fallback improvements. - Add multi-table
DROP TABLEplanning/execution support (including privilege checks), protobuf updates, and distributed SQL test cases.
Reviewed changes
Copilot reviewed 32 out of 34 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/distributed/cases/join/apply.result | Updates expected output now that JSON→BIGINT casting succeeds for a previous failing query. |
| test/distributed/cases/function/func_null_safe_equal.sql | Adds distributed SQL coverage for <=> behavior across types and NULLs. |
| test/distributed/cases/function/func_null_safe_equal.result | Expected results for <=> distributed SQL tests. |
| test/distributed/cases/function/func_json_arrow.sql | Adds distributed SQL coverage for JSON -> / ->> operators. |
| test/distributed/cases/function/func_json_arrow.result | Expected results for JSON arrow operator distributed SQL tests. |
| test/distributed/cases/ddl/drop_table_multiple.sql | Adds distributed SQL cases for multi-table DROP TABLE semantics and errors. |
| test/distributed/cases/ddl/drop_table_multiple.result | Expected results for multi-table DROP TABLE distributed SQL cases. |
| proto/plan.proto | Extends DropTable plan message to carry per-table entries for multi-drop statements. |
| pkg/sql/plan/function/list_operator.go | Registers <=> as an operator with typing/casting rules. |
| pkg/sql/plan/function/init.go | Adds encoded ID/name constants for <=>. |
| pkg/sql/plan/function/function_id_test.go | Updates function ID registry test to include NULL_SAFE_EQUAL. |
| pkg/sql/plan/function/function_id.go | Adds function ID and registry entry for <=>. |
| pkg/sql/plan/function/func_compare_test.go | Adds tests for mismatch comparisons (large integers, special floats) and <=> mismatch behavior. |
| pkg/sql/plan/function/func_compare_fix.go | Reworks numeric type-mismatch comparisons to avoid float precision loss (big.Rat-based path + approximate float path) and adds null-safe variant. |
| pkg/sql/plan/function/func_compare.go | Implements runtime <=> evaluation; updates numeric mismatch fallback callsites to new comparator signature. |
| pkg/sql/plan/function/func_cast_test.go | Adds tests for JSON→(u)int64 precision and overflow behavior. |
| pkg/sql/plan/function/func_cast.go | Adds JSON→numeric cast support with stricter parsing/overflow handling. |
| pkg/sql/plan/deepcopy.go | Adds DeepCopyDropTable and uses it for drop-table DDL deep copying (supports nested multi-drop entries). |
| pkg/sql/plan/build_expr_test.go | Adds planner test ensuring tuple <=> binds correctly (including single-element tuple edge). |
| pkg/sql/plan/build_ddl_test.go | Adds test for FK sentinel handling when dropping tables with targets. |
| pkg/sql/plan/build_ddl.go | Implements multi-table DROP TABLE plan building and FK-aware allow/deny logic across multiple targets. |
| pkg/sql/plan/build_alter_table_test.go | Adds tests ensuring JSON→numeric remains blocked for DDL type changes. |
| pkg/sql/plan/build_alter_modify_column.go | Blocks JSON→numeric for DDL modify-column while allowing JSON→text. |
| pkg/sql/plan/base_binder.go | Adds binding logic for <=>, including tuple comparison lowering to element-wise <=> + and. |
| pkg/sql/parsers/dialect/mysql/scanner.go | Extends lexer to produce tokens for -> and ->> (ARROW/LONG_ARROW). |
| pkg/sql/parsers/dialect/mysql/mysql_sql_test.go | Adds formatting/printing tests for -> / ->> rewriting to function calls. |
| pkg/sql/parsers/dialect/mysql/mysql_sql.y | Adds grammar rules for JSON arrow operators and their precedence. |
| pkg/sql/compile/ddl.go | Supports executing multi-table drop plans and skips no-op entries; adds warning/continue behavior for missing FK-child tables. |
| pkg/sql/compile/compile_test.go | Adds compile unit test for pre-pipeline lock decision logic (INSERT vs LOAD DATA). |
| pkg/sql/compile/compile.go | Restores pre-pipeline locking for LOAD DATA while keeping INSERT lock deferral behavior. |
| pkg/frontend/authenticate_test.go | Adds extensive auth tests for multi-drop privilege/ownership fallback behavior and no-op entries. |
| pkg/frontend/authenticate.go | Updates privilege tip extraction and privilege enforcement for multi-table DROP TABLE; updates implicit revoke logic for multi-drop. |
LeftHandCold
force-pushed
the
fix/load-data-table-lock-regression
branch
from
April 27, 2026 08:53
1600798 to
2bd2e83
Compare
Co-authored-by: Copilot <[email protected]>
LeftHandCold
force-pushed
the
fix/load-data-table-lock-regression
branch
from
April 27, 2026 12:24
099d4c7 to
fac0ccd
Compare
ouyuanning
approved these changes
Apr 27, 2026
XuPeng-SH
approved these changes
Apr 27, 2026
Contributor
Merge Queue Status
This pull request spent 18 seconds in the queue, including 3 seconds running CI. Required conditions to merge
|
1 of 7 tasks
1 task done
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:
issue #24213
What this PR does / why we need it:
PR #24201 moved Query_INSERT table locking off the pre-pipeline path. LOAD DATA is also planned as Query_INSERT and always carries a table-locking LockOp, so TPCH 1T load started taking that path too and the nightly load phase regressed noticeably after b79773d.
This patch keeps the #24201 behavior for regular INSERT statements, but restores the pre-pipeline table lock for LOAD DATA only. That keeps the fix scope narrow and avoids changing unrelated INSERT paths again.
A compile test was added to lock the routing behavior between regular INSERT and LOAD DATA.