diff --git a/e2e_test/batch/basic/dml_update.slt.part b/e2e_test/batch/basic/dml_update.slt.part index 580a74ba44368..c5a699f160c6c 100644 --- a/e2e_test/batch/basic/dml_update.slt.part +++ b/e2e_test/batch/basic/dml_update.slt.part @@ -108,5 +108,11 @@ statement error source for a multiple-column UPDATE item must be a sub-SELECT or update t set (v1, v2) = v1 + 1; +# Assignment to system columns. +statement error update modifying column `_rw_timestamp` is unsupported +update t set _rw_timestamp = _rw_timestamp + interval '1 second'; + + + statement ok drop table t; diff --git a/src/frontend/src/binder/update.rs b/src/frontend/src/binder/update.rs index 9fce6bf44bd98..f57ad1d197982 100644 --- a/src/frontend/src/binder/update.rs +++ b/src/frontend/src/binder/update.rs @@ -247,6 +247,11 @@ impl Binder { ) .into()); } + + let col = &table.table_catalog.columns()[id_index]; + if !col.can_dml() { + bail_bind_error!("update modifying column `{}` is unsupported", col.name()); + } } let (returning_list, fields) = self.bind_returning_list(returning_items)?;