matrixorigin / matrixorigin/matrixone

[Subtask]: Enforce explicit PARTITION restrictions for REPLACE

Open
#24,953 0 comments 0 reactions 1 assignee Claimed by @ck89119 View on GitHub
area/partition deferred kind/subtask
Dominant language
Go
Stars
1.9k
Forks
311
Avg merge
1d 3h
Merged PRs (30d)
768

Description

## Parent Issue

Parent issue: #24918

## Detail of Subtask

Honor explicit `PARTITION(...)` restrictions for `REPLACE` statements.

Reference case from the parent issue:

```sql
create table t_pr(id int primary key, v int)
partition by range(id)(
partition p0 values less than (10),
partition p1 values less than (20)
);
insert into t_pr values (1,10),(11,110);

replace into t_pr partition(p0) values (15,150);
```

Expected MySQL-compatible behavior: fail because `(15, 150)` does not belong to the explicitly selected `p0` partition.

MatrixOne currently inserts the row despite the explicit partition restriction.

## Describe implementation you've considered

Propagate explicit partition selections through `REPLACE` planning/execution and validate every inserted replacement row against the selected partition set. Add tests for both insert-only and duplicate-key replacement paths.

## Additional information

Parent context: #24918, comment section 6.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.