Fix failure to set correct operator in window run condition
authorDavid Rowley <[email protected]>
Thu, 4 Aug 2022 22:14:40 +0000 (10:14 +1200)
committerDavid Rowley <[email protected]>
Thu, 4 Aug 2022 22:14:40 +0000 (10:14 +1200)
commit270eb4b5d4986534f2d522ebb19f67396d13cf44
tree313b3dd8d1d6678592575b6a8177c48ddf4e4705
parent6f7e7d0c482dd3c635f0de8e77fe6f783e43a078
Fix failure to set correct operator in window run condition

This was a simple omission in 9d9c02ccd where the code didn't correctly
set the operator to use in the run condition OpExpr when the window
function was both monotonically increasing and decreasing.

Bug discovered by Julien Roze, although he did not report it.

Reported-by: Phil Florent
Discussion: https://postgr.es/m/PA4P191MB160009A09B9D0624359278CFBA9F9@PA4P191MB1600.EURP191.PROD.OUTLOOK.COM
Backpatch-through: 15, where 9d9c02ccd was added
src/backend/optimizer/path/allpaths.c
src/test/regress/expected/window.out
src/test/regress/sql/window.sql