Files
email-tracker/external/duckdb/test/fuzzer/pedro/alter_column_generated.test
2025-10-24 19:21:19 -05:00

39 lines
765 B
SQL

# name: test/fuzzer/pedro/alter_column_generated.test
# description: Issue #4677: heap-buffer-overflow on ALTER statement
# group: [pedro]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE t0(c0 AS (1), c1 INT);
statement ok
ALTER TABLE t0 ALTER c1 SET NOT NULL;
statement ok
ALTER TABLE t0 ALTER c1 SET NOT NULL;
statement error
ALTER TABLE t0 ALTER c0 SET NOT NULL;
----
<REGEX>:Binder Error.*Unsupported constraint.*
statement error
INSERT INTO t0 VALUES (NULL);
----
<REGEX>:Constraint Error.*NOT NULL.*failed.*
statement ok
DROP TABLE t0;
statement ok
CREATE TABLE t0(c0 AS (1), c1 INT);
statement ok
INSERT INTO t0 VALUES (NULL);
statement error
ALTER TABLE t0 ALTER c1 SET NOT NULL;
----
<REGEX>:Constraint Error.*NOT NULL.*failed.*