diff --git a/src/mito2/src/worker/handle_write.rs b/src/mito2/src/worker/handle_write.rs index 9b7693710b32..ca9a1b31a391 100644 --- a/src/mito2/src/worker/handle_write.rs +++ b/src/mito2/src/worker/handle_write.rs @@ -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", } ); } diff --git a/tests/cases/standalone/common/insert/append_mode.result b/tests/cases/standalone/common/insert/append_mode.result index a9b4d5aa51da..4fe1166ae6e2 100644 --- a/tests/cases/standalone/common/insert/append_mode.result +++ b/tests/cases/standalone/common/insert/append_mode.result @@ -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, diff --git a/tests/cases/standalone/common/insert/append_mode.sql b/tests/cases/standalone/common/insert/append_mode.sql index 1e128c440f1b..a27a66f4e013 100644 --- a/tests/cases/standalone/common/insert/append_mode.sql +++ b/tests/cases/standalone/common/insert/append_mode.sql @@ -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,