In the 13483, final plan doesn't contain SortExec where it should. I have traced the reason and recognized that during constantness evaluation, when all children of an expression is contant expression is treated as constant. This is a valid assumption for BinaryExpr, or CastExpr. However, this shouldn't be the case for CaseExpr. This PR fixes this problem.
Which issue does this PR close?
Closes 13483.
Rationale for this change
In the 13483, final plan doesn't contain
SortExec
where it should. I have traced the reason and recognized that during constantness evaluation, when all children of an expression is contant expression is treated as constant. This is a valid assumption forBinaryExpr
, orCastExpr
. However, this shouldn't be the case forCaseExpr
. This PR fixes this problem.What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?