Get rid of ojrelid local variable in remove_rel_from_query() As spotted by Coverity, the calculation of ojrelid mixes signed and unsigned types causes possible overflow and undefined behavior. Instead of trying to fix the expression, this commit eliminates the relied local variable. The explicit branching is used to replace the -1 value. That, in turn, requires changing the signature of the remove_rel_from_eclass() function.
Reported-by: Tom Lane <t...@sss.pgh.pa.us> Discussion: https://postgr.es/m/914330.1740330169%40sss.pgh.pa.us Reviewed-by: Andrei Lepikhov <lepi...@gmail.com> Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/e167191dc146b65146fbd32e147be30dd8f1f166 Modified Files -------------- src/backend/optimizer/plan/analyzejoins.c | 81 ++++++++++++++++++++----------- 1 file changed, 53 insertions(+), 28 deletions(-)