Class GetCurrentConnectionNode
java.lang.Object
org.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.JavaValueNode
org.apache.derby.impl.sql.compile.GetCurrentConnectionNode
- All Implemented Interfaces:
Visitable
This node represents a unary getCurrentConnection operator
RESOLVE - parameter will always be null for now. Someday
we may want to allow user to specify which of their connections
they want. Assume that we will use a String.
-
Field Summary
Fields inherited from class JavaValueNode
forCallStatement, jsqlTypeFields inherited from class QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for a GetCurrentConnectionNode -
Method Summary
Modifier and TypeMethodDescription(package private) JavaValueNodebindExpression(FromList fromList, SubqueryList subqueryList, List<AggregateNode> aggregates) Bind this operator(package private) voidBind a ?(package private) booleancategorize(JBitSet referencedTabs, boolean simplePredsOnly) Categorize this predicate.(package private) voidcheckReliability(ValueNode sqlNode) Check the reliability type of this java value.(package private) voidGeneral logic shared by Core compilation and by the Replication Filter compiler.(package private) intReturn the variant type for the underlying expression.(package private) voidpreprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) Preprocess an expression tree.(package private) JavaValueNodeRemap all ColumnReferences in this tree to be clones of the underlying expression.Methods inherited from class JavaValueNode
castToPrimitive, generate, generateReceiver, generateReceiver, getCollationType, getConstantValueAsObject, getDataType, getJavaTypeName, getJSQLType, getPrimitiveTypeName, getReceiverExpression, isPrimitiveType, mapToTypeID, markForCallStatement, markReturnValueDiscarded, mustCastToPrimitive, returnValueDiscarded, returnValueToSQLDomain, setCollationType, setJavaTypeName, valueReturnedToSQLDomainMethods inherited from class QueryTreeNode
accept, acceptChildren, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isAtomic, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, printSubNodes, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, toString, treePrint, treePrint, verifyClassExist
-
Constructor Details
-
GetCurrentConnectionNode
GetCurrentConnectionNode(ContextManager cm) Constructor for a GetCurrentConnectionNode
-
-
Method Details
-
bindExpression
JavaValueNode bindExpression(FromList fromList, SubqueryList subqueryList, List<AggregateNode> aggregates) throws StandardException Bind this operator- Specified by:
bindExpressionin classJavaValueNode- Parameters:
fromList- The query's FROM listsubqueryList- The subquery list being built as we find SubqueryNodesaggregates- The aggregate list being built as we find AggregateNodes- Returns:
- the new node, usually this
- Throws:
StandardException- Thrown on error- See Also:
-
preprocess
void preprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) throws StandardException 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.- Specified by:
preprocessin classJavaValueNode- Parameters:
numTables- Number of tables in the DML StatementouterFromList- FromList from outer query blockouterSubqueryList- SubqueryList from outer query blockouterPredicateList- PredicateList from outer query block- Throws:
StandardException- Thrown on error- See Also:
-
categorize
Categorize this predicate. Initially, this means building a bit map of the referenced tables for each predicate. If the source of this ColumnReference (at the next underlying level) is not a ColumnReference or a VirtualColumnNode then this predicate will not be pushed down. For example, in: select * from (select 1 from s) a (x) where x = 1 we will not push down x = 1. NOTE: It would be easy to handle the case of a constant, but if the inner SELECT returns an arbitrary expression, then we would have to copy that tree into the pushed predicate, and that tree could contain subqueries and method calls. RESOLVE - revisit this issue once we have views.- Specified by:
categorizein classJavaValueNode- Parameters:
referencedTabs- JBitSet with bit map of referenced FromTablessimplePredsOnly- Whether or not to consider method calls, field references and conditional nodes when building bit map- Returns:
- boolean Whether or not source.expression is a ColumnReference or a VirtualColumnNode.
- See Also:
-
remapColumnReferencesToExpressions
JavaValueNode remapColumnReferencesToExpressions()Remap all ColumnReferences in this tree to be clones of the underlying expression.- Specified by:
remapColumnReferencesToExpressionsin classJavaValueNode- Returns:
- JavaValueNode The remapped expression tree.
- See Also:
-
bindParameter
void bindParameter()Bind a ? parameter operand of the char_length function. -
getOrderableVariantType
int getOrderableVariantType()Return the variant type for the underlying expression. The variant type can be: VARIANT - variant within a scan (method calls and non-static field access) SCAN_INVARIANT - invariant within a scan (column references from outer tables) QUERY_INVARIANT - invariant within the life of a query (constant expressions)- Overrides:
getOrderableVariantTypein classJavaValueNode- Returns:
- The variant type for the underlying expression.
-
generateExpression
Description copied from class:JavaValueNodeGeneral logic shared by Core compilation and by the Replication Filter compiler. Every child of ValueNode must implement one of these methods.- Specified by:
generateExpressionin classJavaValueNode- Parameters:
acb- The ExpressionClassBuilder for the class being builtmb- The method the code to place the code- Throws:
StandardException- Thrown on error- See Also:
-
checkReliability
Check the reliability type of this java value.- Overrides:
checkReliabilityin classJavaValueNode- Throws:
StandardException- Thrown on error- See Also:
-