apache / cloudberry

One advanced and mature open-source MPP (Massively Parallel Processing) database. Open source alternative to Greenplum Database.
https://cloudberry.apache.org
Apache License 2.0
433 stars 104 forks source link

Fix writable CTE cause wrong matview data status. #602

Closed avamingli closed 2 months ago

avamingli commented 2 months ago

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:

avamingli commented 2 months ago

With this pr, all issues of #582 should be resolved.