Skip to content

Commit

Permalink
chore: Add delete test for append mode
Browse files Browse the repository at this point in the history
  • Loading branch information
evenyag committed Apr 2, 2024
1 parent 6d364f6 commit e2045dc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mito2/src/worker/handle_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ fn check_op_type(append_mode: bool, request: &WriteRequest) -> Result<()> {
request.op_type == OpType::Put,
InvalidRequestSnafu {
region_id: request.region_id,
reason: "Only put is allowed under append mode",
reason: "DELETE is not allowed under append mode",
}
);
}
Expand Down
5 changes: 5 additions & 0 deletions tests/cases/standalone/common/insert/append_mode.result
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ SELECT * from append_mode_on ORDER BY host, ts;
| host2 | 1970-01-01T00:00:00.001 | 1.0 |
+-------+-------------------------+-----+

-- SQLNESS REPLACE (region\s\d+\(\d+\,\s\d+\)) region
DELETE FROM append_mode_on WHERE host = 'host1';

Error: 1004(InvalidArguments), Invalid request to region, reason: DELETE is not allowed under append mode

create table if not exists append_mode_off(
host string,
ts timestamp,
Expand Down
3 changes: 3 additions & 0 deletions tests/cases/standalone/common/insert/append_mode.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ INSERT INTO append_mode_on VALUES ('host1',0, 0), ('host2', 1, 1,);

SELECT * from append_mode_on ORDER BY host, ts;

-- SQLNESS REPLACE (region\s\d+\(\d+\,\s\d+\)) region
DELETE FROM append_mode_on WHERE host = 'host1';

create table if not exists append_mode_off(
host string,
ts timestamp,
Expand Down

0 comments on commit e2045dc

Please sign in to comment.