There is currently a bug found in our materialized view implementation
that happens when we delete a row, and then re-insert another row with
the same primary key.
Our insert code needs to detect updates and generate a DELETE +
INSERT. But in this case, after the initial DELETE, the fresh insert
generates another delete.
We ended up with the wrong response for aggregations (and I am pretty
sure even filter-only views would manifest the bug as well), where
groups that should still be present just disappeared because of the
extra delete.
A new test case is added that fails without the fix.
When adding tests for extensions, please follow these guidelines:
Tests that verify the internal logic or behavior of a particular extension should go into cli_tests/extensions.py.
Tests that verify how extensions interact with the database engine, such as virtual table handling, should be written
in TCL (see vtab.test as an example).
To check which extensions are available in TCL, or to add a new one, refer to the tester.tcl file and look at the extension_map.