Skip to content

Unused variable attrs_used and redundant pull_varattnos call in mysqlGetForeignRelSize #329

Description

@Meta11ic0

Bug Report

Summary

In mysqlGetForeignRelSize() (mysql_fdw.c), a local variable attrs_used
is declared and populated via pull_varattnos(), but its result is never
read or used anywhere afterward. The same expression tree is collected again
a few lines later into fpinfo->attrs_used, which is the variable actually
consumed by the rest of the planning logic.

Redundant code

/* Line ~991 */
Bitmapset  *attrs_used = NULL;

/* Lines ~1026-1027: result written to attrs_used but never read */
pull_varattnos((Node *) baserel->reltarget->exprs, baserel->relid,
               &attrs_used);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions