* are_peers * compare two rows to see if they are equal according to the ORDER BY clause * * NB: this does not consider the window frame mode. */
| 3304 | * NB: this does not consider the window frame mode. |
| 3305 | */ |
| 3306 | static bool |
| 3307 | are_peers(WindowAggState *winstate, TupleTableSlot *slot1, |
| 3308 | TupleTableSlot *slot2) |
| 3309 | { |
| 3310 | WindowAgg *node = (WindowAgg *) winstate->ss.ps.plan; |
| 3311 | ExprContext *econtext = winstate->tmpcontext; |
| 3312 | |
| 3313 | /* If no ORDER BY, all rows are peers with each other */ |
| 3314 | if (node->ordNumCols == 0) |
| 3315 | return true; |
| 3316 | |
| 3317 | econtext->ecxt_outertuple = slot1; |
| 3318 | econtext->ecxt_innertuple = slot2; |
| 3319 | return ExecQualAndReset(winstate->ordEqfunction, econtext); |
| 3320 | } |
| 3321 | |
| 3322 | /* |
| 3323 | * window_gettupleslot |
no test coverage detected