Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfbf8042

Browse files
committed
Re-allow INDEX_VAR as rt_index in ChangeVarNodes().
Apparently some extensions are in the habit of callingChangeVarNodes() with INDEX_VAR as the rt_index to replace.That worked before2489d76, at least as long as there werenot PlaceHolderVars in the expression; but now it failsbecause bms_is_member spits up. Add a test to avoid that.Per report from Anton Melnikov, though this is not hisproposed patch.Discussion:https://postgr.es/m/5b370a46-f6d2-373d-9dbc-0d55250e82c1@inbox.ru
1 parentd98ed08 commitfbf8042

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/backend/rewrite/rewriteManip.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,11 +719,16 @@ ChangeVarNodes(Node *node, int rt_index, int new_index, int sublevels_up)
719719

720720
/*
721721
* Substitute newrelid for oldrelid in a Relid set
722+
*
723+
* Note: some extensions may pass a special varno such as INDEX_VAR for
724+
* oldrelid. bms_is_member won't like that, but we should tolerate it.
725+
* (Perhaps newrelid could also be a special varno, but there had better
726+
* not be a reason to inject that into a nullingrels or phrels set.)
722727
*/
723728
staticRelids
724729
adjust_relid_set(Relidsrelids,intoldrelid,intnewrelid)
725730
{
726-
if (bms_is_member(oldrelid,relids))
731+
if (!IS_SPECIAL_VARNO(oldrelid)&&bms_is_member(oldrelid,relids))
727732
{
728733
/* Ensure we have a modifiable copy */
729734
relids=bms_copy(relids);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp