CTE is not well supported in GPDB, if a writable operation inside CTE is actually executed, it may cause matview data status fail to catch up with the underlying relation.
create table t_cte_issue_582(i int, j int);
create materialized view mv_t_cte_issue_582 as select j from t_cte_issue_582 where i = 1;
with mod1 as (insert into t_cte_issue_582 values(1, 1) returning ) select from mod1;
The CTE sql will insert data into t_cte_issue_582, and the data status of matviews have that relation should be updated.
CTE is not well supported in GPDB, if a writable operation inside CTE is actually executed, it may cause matview data status fail to catch up with the underlying relation.
create table t_cte_issue_582(i int, j int); create materialized view mv_t_cte_issue_582 as select j from t_cte_issue_582 where i = 1; with mod1 as (insert into t_cte_issue_582 values(1, 1) returning ) select from mod1;
The CTE sql will insert data into t_cte_issue_582, and the data status of matviews have that relation should be updated.
Fix CTE part issue of https://github.com/cloudberrydb/cloudberrydb/issues/582
Authored-by: Zhang Mingli avamingli@gmail.com
fix #ISSUE_Number
Change logs
Describe your change clearly, including what problem is being solved or what feature is being added.
If it has some breaking backward or forward compatibility, please clary.
Why are the changes needed?
Describe why the changes are necessary.
Does this PR introduce any user-facing change?
If yes, please clarify the previous behavior and the change this PR proposes.
How was this patch tested?
Please detail how the changes were tested, including manual tests and any relevant unit or integration tests.
Contributor's Checklist
Here are some reminders and checklists before/when submitting your pull request, please check them:
make installcheck
make -C src/test installcheck-cbdb-parallel
cloudberrydb/dev
team for review and approval when your PR is ready🥳