Comment 5 for bug 1240413

Revision history for this message
Alvin Peng (pengalvin) wrote :

modify file: src/org/postgresql/stado/planner/QueryPlan.java
line 4132,

change

                boolean isSelColumn = aLeaf.isProjection(aSqlExpression.getExprString());

to

                boolean isSelColumn = aLeaf.isProjection(aSqlExpression.getExprString())
                                   && !aSqlExpression.isConstantExpr();

Check whether the expression is constantExpr or not. If it is constantExpr, added it to the CREATE TABLE even if the same value is already added.

This can fix the bug described above.

There are some other codes that call the "isProjection" method, but seems they are not related to this.