Bug: WindowAgg parameter type discovery does not return when frame offsets contain remote params

Aperta
#217 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #218 di @Aias00 — chiusa senza merge

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
c
Ambito
databases

Direzione di ricerca

Read determine_param_types() in src/backend/pgxc/pool/execRemote.c and compare its T_WindowAgg branch with the nearby T_Limit branch and the T_WindowAgg handling in src/backend/nodes/nodeFuncs.c. Add the two early returns described in the issue, then run git diff --check and compile execRemote.o using the listed configure options. Done when both frame offsets propagate successful parameter discovery.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

determine_param_types() in src/backend/pgxc/pool/execRemote.c has incomplete handling for T_WindowAgg.

In the T_WindowAgg branch, it walks startOffset and endOffset, but does not return true when determine_param_types_walker() finds all required parameters. The code also lacks the same explicit return
pattern used by nearby plan-node branches such as T_Limit.

Current code:

case T_WindowAgg:
    if (expression_tree_walker((Node *) ((WindowAgg *) plan)->startOffset,
                               determine_param_types_walker,
                               (void *) context))
    if (expression_tree_walker((Node *) ((WindowAgg *) plan)->endOffset,
                               determine_param_types_walker,
                               (void *) context))
    break;

Expected behavior:

case T_WindowAgg:
    if (expression_tree_walker((Node *) ((WindowAgg *) plan)->startOffset,
                               determine_param_types_walker,
                               (void *) context))
        return true;
    if (expression_tree_walker((Node *) ((WindowAgg *) plan)->endOffset,
                               determine_param_types_walker,
                               (void *) context))
        return true;
    break;

## Impact

Remote subplans containing window functions with parameterized frame offsets may fail to discover parameter types correctly. This can cause missing or incorrect remote parameter metadata during distributed
execution.

This is similar in nature to the missing T_ProjectSet handling fixed for SRF target-list plans: both issues are in determine_param_types() and affect remote parameter type discovery for specific plan nodes.

## Evidence

The generic plan tree walker in src/backend/nodes/nodeFuncs.c handles T_WindowAgg offsets with explicit early returns for both startOffset and endOffset, while execRemote.c does not.

## Suggested fix

Add return true; after both expression_tree_walker() calls in the T_WindowAgg branch of determine_param_types().

## Verification

A minimal patch adding the two missing return true; statements compiles successfully:

- git diff --check
- Ubuntu 20.04 container:
    - ./configure --enable-user-switch --with-openssl --with-ossp-uuid CFLAGS=-g
    - make -C src/backend generated-headers
    - make -C src/backend/pgxc/pool execRemote.o
Lingua principale
C
Stelle
946
Fork
693
Merge medio
5m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenTenBase/OpenTenBase

Tutte le issue di OpenTenBase/OpenTenBase

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.