OSDN Git Service

Teach eval_const_expressions() to simplify an ArrayCoerceExpr to a constant
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 26 Aug 2008 02:16:31 +0000 (02:16 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 26 Aug 2008 02:16:31 +0000 (02:16 +0000)
commit6734182c169a1ecb74dd8495004e896ee4519adb
tree938ca54b31b0bfe010052740dfc53e79552eeeb5
parent6741688b169acc5fbcc4f198b209e9f3177579c9
Teach eval_const_expressions() to simplify an ArrayCoerceExpr to a constant
when its input is constant and the element coercion function is immutable
(or nonexistent, ie, binary-coercible case).  This is an oversight in the
8.3 implementation of ArrayCoerceExpr, and its result is that certain cases
involving IN or NOT IN with constants don't get optimized as they should be.
Per experimentation with an example from Ow Mun Heng.
src/backend/optimizer/util/clauses.c