1 21 22 package org.apache.derby.impl.sql.compile; 23 24 import org.apache.derby.iapi.sql.dictionary.DataDictionary; 25 26 import org.apache.derby.iapi.types.TypeId; 27 28 import org.apache.derby.iapi.reference.SQLState; 29 import org.apache.derby.iapi.error.StandardException; 30 import org.apache.derby.iapi.types.DataTypeDescriptor; 31 32 import org.apache.derby.iapi.services.sanity.SanityManager; 33 34 import java.util.Vector ; 35 36 public abstract class UnaryLogicalOperatorNode extends UnaryOperatorNode 37 { 38 46 47 public void init( 48 Object operand, 49 Object methodName) 50 { 51 52 super.init(operand, methodName, methodName); 53 } 54 55 68 69 public ValueNode bindExpression( 70 FromList fromList, SubqueryList subqueryList, 71 Vector aggregateVector) 72 throws StandardException 73 { 74 super.bindExpression(fromList, subqueryList, 75 aggregateVector); 76 77 86 87 if ( ! operand.getTypeServices().getTypeId().equals(TypeId.BOOLEAN_ID)) 88 { 89 operand.treePrint(); 90 throw StandardException.newException(SQLState.LANG_UNARY_LOGICAL_NON_BOOLEAN); 91 } 92 93 94 setFullTypeInfo(); 95 96 return this; 97 } 98 99 106 protected void setFullTypeInfo() 107 throws StandardException 108 { 109 boolean nullableResult; 110 111 118 nullableResult = operand.getTypeServices().isNullable(); 119 setType(new DataTypeDescriptor(TypeId.BOOLEAN_ID, nullableResult)); 120 } 121 } 122 | Popular Tags |