Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FIXME about redundant param from 'ivm_visible_in_prestate' call. #578

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/backend/commands/matview.c
Original file line number Diff line number Diff line change
Expand Up @@ -2093,6 +2093,11 @@ ivm_visible_in_prestate(PG_FUNCTION_ARGS)
Oid tableoid = PG_GETARG_OID(0);
ItemPointer itemPtr = PG_GETARG_ITEMPOINTER(1);
Oid matviewOid = PG_GETARG_OID(2);
/*
CBDB_PG_15_FIXME: Here, we do not use the 4th argument of this function.
Either justify its existence by using it, or remove the 4th argument from
the function definition (catalog change).
*/
ListCell *lc;
bool result = true;
bool found = false;
Expand Down Expand Up @@ -2175,7 +2180,7 @@ get_prestate_rte(RangeTblEntry *rte, MV_TriggerTable *table,
initStringInfo(&str);
appendStringInfo(&str,
"SELECT t.* FROM %s t"
" WHERE pg_catalog.ivm_visible_in_prestate(t.tableoid, t.ctid,%d::pg_catalog.oid, t.gp_segment_id)",
" WHERE pg_catalog.ivm_visible_in_prestate(t.tableoid, t.ctid, %d::pg_catalog.oid, t.gp_segment_id)",
reshke marked this conversation as resolved.
Show resolved Hide resolved
relname, matviewid);

/*
Expand All @@ -2189,6 +2194,8 @@ get_prestate_rte(RangeTblEntry *rte, MV_TriggerTable *table,
tuplestore_get_sharedname(tuplestore));
}

elogif(Debug_print_ivm, INFO, "IVM execute prestate visibilty chek new %s", str.data);

/* Get a subquery representing pre-state of the table */
raw = (RawStmt*)linitial(raw_parser(str.data, RAW_PARSE_DEFAULT));
subquery = transformStmt(pstate, raw->stmt);
Expand Down Expand Up @@ -3857,4 +3864,4 @@ ivm_set_ts_persitent_name(TriggerData *trigdata, Oid relid, Oid mvid)
oldctx = MemoryContextSwitchTo(TopMemoryContext);
SetTransitionTableName(relid, cmd, mvid);
MemoryContextSwitchTo(oldctx);
}
}
Loading