| Modifier and Type | Field and Description |
|---|---|
| private boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv | OrNode(ValueNode
The left operand of the OR leftOperand, ValueNode The right operand of the OR rightOperand, ContextManager The context manager cm)Constructor for an OrNode |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv ValueNode | Returns: The new top of the expression tree.The query's FROM list fromList, SubqueryList The subquery list being built as we find SubqueryNodes subqueryList, List<AggregateNode> The aggregate list being built as we find AggregateNodes aggregates)Overrides org. Bind this logical operator. |
| pack-priv ValueNode | Returns: The modified expressionWhether or not we are under a top level AndNode. underTopAndNode)Overrides org. Finish putting an expression into conjunctive normal form. |
| pack-priv ValueNode | Returns: The modified expressionWhether or not we are under a NotNode. underNotNode)Overrides org. Eliminate NotNodes in the current query block. |
| pack-priv void | postBindFixup()
Do bind() by hand for an AndNode that was generated after bind(), eg by putAndsOnTop(). |
| pack-priv ValueNode | Returns: The modified expressionNumber of tables in the DML Statement numTables, FromList FromList from outer query block outerFromList, SubqueryList SubqueryList from outer query block outerSubqueryList, PredicateList PredicateList from outer query block outerPredicateList)Overrides org. Preprocess an expression tree. |
| pack-priv void | |
| pack-priv boolean | Returns: Boolean which reflects validity of the tree.Overrides org. Verify that changeToCNF() did its job correctly. |
| firstOr | back to summary |
|---|---|
| private boolean firstOr | |
| OrNode | back to summary |
|---|---|
| pack-priv OrNode(ValueNode leftOperand, ValueNode rightOperand, ContextManager cm) Constructor for an OrNode
| |
| bindExpression | back to summary |
|---|---|
| pack-priv ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, List<AggregateNode> aggregates) throws StandardException Overrides org. Bind this logical operator. All that has to be done for binding a logical operator is to bind the operands, check that both operands are BooleanDataValue, and set the result type to BooleanDataValue.
| |
| changeToCNF | back to summary |
|---|---|
| pack-priv ValueNode changeToCNF(boolean underTopAndNode) throws StandardException Overrides org. Finish putting an expression into conjunctive normal form. An expression tree in conjunctive normal form meets the following criteria: o If the expression tree is not null, the top level will be a chain of AndNodes terminating in a true BooleanConstantNode. o The left child of an AndNode will never be an AndNode. o Any right-linked chain that includes an AndNode will be entirely composed of AndNodes terminated by a true BooleanConstantNode. o The left child of an OrNode will never be an OrNode. o Any right-linked chain that includes an OrNode will be entirely composed of OrNodes terminated by a false BooleanConstantNode. o ValueNodes other than AndNodes and OrNodes are considered leaf nodes for purposes of expression normalization. In other words, we won't do any normalization under those nodes. In addition, we track whether or not we are under a top level AndNode. SubqueryNodes need to know this for subquery flattening.
| |
| eliminateNots | back to summary |
|---|---|
| pack-priv ValueNode eliminateNots(boolean underNotNode) throws StandardException Overrides org. Eliminate NotNodes in the current query block. We traverse the tree, inverting ANDs and ORs and eliminating NOTs as we go. We stop at ComparisonOperators and boolean expressions. We invert ComparisonOperators and replace boolean expressions with boolean expression = false. Note Since we do not recurse under ComparisonOperators, there still could be NotNodes left in the tree.
| |
| postBindFixup | back to summary |
|---|---|
| pack-priv void postBindFixup() throws StandardException Do bind() by hand for an AndNode that was generated after bind(), eg by putAndsOnTop(). (Set the data type and nullability info.)
| |
| preprocess | back to summary |
|---|---|
| pack-priv ValueNode preprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) throws StandardException Overrides org. Preprocess an expression tree. We do a number of transformations here (including subqueries, IN lists, LIKE and BETWEEN) plus subquery flattening. Note This is done before the outer ResultSetNode is preprocessed.
| |
| setFirstOr | back to summary |
|---|---|
| pack-priv void setFirstOr() Mark this OrNode as the 1st OR in the OR chain. We will consider converting the chain to an IN list during preprocess() if all entries are of the form: ColumnReference = expression | |
| verifyChangeToCNF | back to summary |
|---|---|
| pack-priv boolean verifyChangeToCNF() Overrides org. Verify that changeToCNF() did its job correctly. Verify that: o AndNode - rightOperand is not instanceof OrNode leftOperand is not instanceof AndNode o OrNode - rightOperand is not instanceof AndNode leftOperand is not instanceof OrNode
| |