diff --git a/test/cql-pytest/test_lwt.py b/test/cql-pytest/test_lwt.py index 058587cff6..61bc1dab3c 100644 --- a/test/cql-pytest/test_lwt.py +++ b/test/cql-pytest/test_lwt.py @@ -62,3 +62,10 @@ def test_lwt_static_condition(cql, table1): # respectively. with pytest.raises(InvalidRequest, match=re.compile('missing', re.IGNORECASE)): cql.execute(f'UPDATE {table1} SET s=2 WHERE p={p} IF r=1') + +# Generate an LWT update where there is no value for the partition key, +# as the WHERE restricts it using `p = {p} AND p = {p+1}`. +# Such quries are rejected. +def test_lwt_empty_partition_range(cql, table1): + with pytest.raises(InvalidRequest): + cql.execute(f"UPDATE {table1} SET r = 9000 WHERE p = 1 AND p = 1000 AND c = 2 IF r = 3")