com.akiban.sql.parser
Class LikeEscapeOperatorNode
java.lang.Object
com.akiban.sql.parser.QueryTreeNode
com.akiban.sql.parser.ValueNode
com.akiban.sql.parser.TernaryOperatorNode
com.akiban.sql.parser.LikeEscapeOperatorNode
- All Implemented Interfaces:
- Visitable
public final class LikeEscapeOperatorNode
- extends TernaryOperatorNode
This node represents a like comparison operator (no escape)
If the like pattern is a constant or a parameter then if possible
the like is modified to include a >= and < operator. In some cases
the like can be eliminated. By adding =, >= or < operators it may
allow indexes to be used to greatly narrow the search range of the
query, and allow optimizer to estimate number of rows to affected.
constant or parameter LIKE pattern with prefix followed by optional wild
card e.g. Derby%
CHAR(n), VARCHAR(n) where n < 255
>= prefix padded with ' ' to length n -- e.g. Derby
<= prefix appended with '' -- e.g. Derby
[ can eliminate LIKE if constant. ]
CHAR(n), VARCHAR(n), LONG VARCHAR where n >= 255
>= prefix backed up one characer
<= prefix appended with ''
no elimination of like
parameter like pattern starts with wild card e.g. %Derby
CHAR(n), VARCHAR(n) where n <= 256
>= ' ' padded with ' ' to length n
<= ''
no elimination of like
CHAR(n), VARCHAR(n), LONG VARCHAR where n > 256
>= NULL
<= ''
Note that the Unicode value '' is defined as not a character value
and can be used by a program for any purpose. We use it to set an upper
bound on a character range with a less than predicate. We only need a single
'' appended because the string 'Derby' is not a valid
String because '' is not a valid character.
| Fields inherited from class com.akiban.sql.parser.TernaryOperatorNode |
DAY_INTERVAL, FRAC_SECOND_INTERVAL, HOUR_INTERVAL, leftInterfaceType, leftOperand, methodName, MINUTE_INTERVAL, MONTH_INTERVAL, operator, operatorType, QUARTER_INTERVAL, receiver, receiverInterfaceType, resultInterfaceType, rightInterfaceType, rightOperand, SECOND_INTERVAL, WEEK_INTERVAL, YEAR_INTERVAL |
|
Method Summary |
void |
init(Object receiver,
Object leftOperand,
Object rightOperand)
Initializer for a LikeEscapeOperatorNode
receiver like pattern [ escape escapeValue ] |
| Methods inherited from class com.akiban.sql.parser.TernaryOperatorNode |
copyFrom, getLeftOperand, getMethodName, getOperator, getReceiver, getRightOperand, init, isEquivalent, printSubNodes, setLeftOperand, setReceiver, setRightOperand, toString |
| Methods inherited from class com.akiban.sql.parser.ValueNode |
getColumnName, getSchemaName, getSourceResultColumn, getTableName, getType, getTypeId, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isConstantExpression, isInListProbeNode, isParameterNode, isRelationalOperator, isSameNodeType, setNullability, setType |
| Methods inherited from class com.akiban.sql.parser.QueryTreeNode |
accept, convertDefaultNode, debugFlush, debugPrint, formatNodeString, getBeginOffset, getDebugOutput, getEndOffset, getNodeFactory, getNodeType, getNullNode, getParserContext, getStatementType, getUserData, init, init, init, init, init, init, init, init, init, init, init, init, isInstanceOf, makeTableName, makeTableName, nodeHeader, printLabel, setBeginOffset, setDebugOutput, setEndOffset, setNodeType, setParserContext, setUserData, stackPrint, treePrint, treePrint, treePrint |
LikeEscapeOperatorNode
public LikeEscapeOperatorNode()
init
public void init(Object receiver,
Object leftOperand,
Object rightOperand)
- Initializer for a LikeEscapeOperatorNode
receiver like pattern [ escape escapeValue ]
- Overrides:
init in class QueryTreeNode
- Parameters:
receiver - The left operand of the like:
column, CharConstant or ParameterleftOperand - The right operand of the like: the patternrightOperand - The optional escape clause, null if not present
Copyright © 2013 Akiban Technologies, Inc. All rights reserved.