package
9.0.0-alpha+incompatible
Repository: https://github.com/pingcap/tidb.git
Documentation: pkg.go.dev

# Packages

# Functions

AdjustNullabilityFromGroupingSets adjust the nullability of the Expand schema out.
Args2Expressions4Test converts these values to an expression list.
BuildCastCollationFunction builds a ScalarFunction which casts the collation.
BuildCastFunction builds a CAST ScalarFunction from the Expression.
BuildCastFunction4Union build a implicitly CAST ScalarFunction from the Union Expression.
BuildCastFunctionWithCheck builds a CAST ScalarFunction from the Expression and return error if any.
BuildFromBinaryFunction builds from_binary function.
BuildGetVarFunction builds a GetVar ScalarFunction from the Expression.
BuildNotNullExpr wraps up `not(isnull())` for given expression.
BuildToBinaryFunction builds to_binary function.
CalAppropriateTime directly calls calAppropriateTime.
CanExprsPushDown return true if all the expr in exprs can be pushed down.
CanExprsPushDownWithExtraInfo return true if all the expr in exprs can be pushed down.
CanImplicitEvalInt represents the builtin functions that have an implicit path to evaluate as integer, regardless of the type that type inference decides it to be.
CanImplicitEvalReal represents the builtin functions that have an implicit path to evaluate as real, regardless of the type that type inference decides it to be.
CheckAndDeriveCollationFromExprs derives collation information from these expressions, return error if derives collation error.
CheckArgsNotMultiColumnRow checks the args are not multi-column row.
CheckFuncInExpr checks whether there's a given function in the expression.
CheckNonDeterministic checks whether the current expression contains a non-deterministic func.
ColInfo2Col finds the corresponding column of the ColumnInfo in a column slice.
Column2Exprs will transfer column slice to expression slice.
ColumnInfos2ColumnsAndNames converts the ColumnInfo to the *Column and NameSlice.
ColumnSubstitute substitutes the columns in filter to expressions in select fields.
ColumnSubstituteAll substitutes the columns just like ColumnSubstitute, but we don't accept partial substitution.
ColumnSubstituteImpl tries to substitute column expr using newExprs, the newFunctionInternal is only called if its child is substituted @return bool means whether the expr has changed.
CompareDecimal compares two decimals.
CompareDuration compares two durations.
CompareInt compares two integers.
CompareJSON compares two JSONs.
CompareReal compares two float-point values.
CompareStringWithCollationInfo compares two strings with the specified collation information.
CompareTime compares two datetime or timestamps.
CompareVectorFloat32 compares two float32 vectors.
ComposeCNFCondition composes CNF items into a balance deep CNF tree, which benefits a lot for pb decoder/encoder.
ComposeDNFCondition composes DNF items into a balance deep DNF tree.
ConstExprConsiderPlanCache indicates whether the expression can be considered as a constant expression considering planCache.
ConstructPositionExpr constructs PositionExpr with the given ParamMarkerExpr.
ContainCorrelatedColumn checks if the expressions contain a correlated column.
ContainOuterNot checks if there is an outer `not`.
Contains tests if `exprs` contains `e`.
ContainVirtualColumn checks if the expressions contain a virtual column.
ConvertJSON2Tp converts JSON to the specified type.
DatumToConstant generates a Constant expression from a Datum.
DeduplicateGbyExpression is try to detect the semantic equivalence expression, and mark them into same position.
DeriveRelaxedFiltersFromDNF given a DNF expression, derive a relaxed DNF expression which only contains columns in specified schema; the derived expression is a superset of original expression, i.e, any tuple satisfying the original expression must satisfy the derived expression.
DisableParseJSONFlag4Expr disables ParseToJSONFlag for `expr` except Column.
EliminateNoPrecisionLossCast remove the redundant cast function for range build convenience.
EvalBool evaluates expression list to a boolean value.
EvalExpr evaluates this expr according to its type.
EvaluateExprWithNull sets columns in schema as null and calculate the final result of the scalar function.
ExecBinaryParam parse execute binary param arguments to datum slice.
ExplainColumnList generates explain information for a list of columns.
ExplainExpressionList generates explain information for a list of expressions.
ExpressionsSemanticEqual is used to judge whether two expression tree is semantic equivalent.
ExpressionsToPBList converts expressions to tipb.Expr list for new plan.
ExprFromSchema checks if all columns of this expression are from the same schema.
ExprHasSetVarOrSleep checks if the expression has SetVar function or Sleep function.
ExprNotNull checks if an expression is possible to be null.
ExprReferenceSchema checks if any column of this expression are from the schema.
ExprsHasSideEffects checks if any of the expressions has side effects.
ExprsToStringsForDisplay convert a slice of Expression to a slice of string using Expression.String(), and to make it better for display and debug, it also escapes the string to corresponding golang string literal, which means using \t, \n, \x??, \u????, ..
ExtractColumns extracts all columns from an expression.
ExtractColumnsAndCorColumnsFromExpressions extracts columns and correlated columns from expressions and append them to `result`.
ExtractColumnSet extracts the different values of `UniqueId` for columns in expressions.
ExtractColumnsFromExpressions is a more efficient version of ExtractColumns for batch operation.
ExtractConstantEqColumnsOrScalar detects the constant equal relationship from CNF exprs.
ExtractCorColumns extracts correlated column from given expression.
ExtractDependentColumns extracts all dependent columns from a virtual column.
ExtractEquivalenceColumns detects the equivalence from CNF exprs.
ExtractFiltersFromDNFs checks whether the cond is DNF.
FieldTypeFromPB converts *tipb.FieldType to *types.FieldType.
Filter the input expressions, append the results to result.
FilterOutInPlace do the filtering out in place.
FindFieldName finds the column name from NameSlice.
FindFieldNameIdxByColName finds the index of corresponding name in the given slice.
FindPrefixOfIndex will find columns in index by checking the unique id.
FindUpperBound looks for column < constant or column <= constant and returns both the column and constant.
FlattenCNFConditions extracts CNF expression's leaf item.
FlattenDNFConditions extracts DNF expression's leaf item.
FoldConstant does constant folding optimization on an expression excluding deferred ones.
GcColumnExprIsTidbShard check whether the expression is tidb_shard().
GetAccurateCmpType uses a more complex logic to decide the EvalType of the two args when compare with each other than getBaseCmpType does.
GetBuiltinList returns a list of builtin functions.
GetCmpFunction get the compare function according to two arguments.
GetColumn allocates a column.
GetDisplayName translate a function name to its display name.
GetExprInsideIsTruth get the expression inside the `istrue_with_null` and `istrue`.
GetFormatBytes convert byte count to value with units.
GetFormatNanoTime convert time in nanoseconds to value with units.
GetFuncArg gets the argument of the function at idx.
GetIntFromConstant gets an integer value from the Constant expression.
GetOptionalEvalPropsForExpr gets all optional evaluation properties that this expression requires.
GetRowLen gets the length if the func is row, returns 1 if not row.
GetStmtMinSafeTime get minSafeTime.
GetStmtTimestamp directly calls getTimeZone with timezone.
GetStringFromConstant gets a string value from the Constant expression.
GetTimeCurrentTimestamp is used for generating a timestamp for some special cases: cast null value to timestamp type with not null flag.
GetTimeValue gets the time value with type tp.
GetUint64FromConstant gets a uint64 from constant expression.
GetUsedList shows whether each column in schema is contained in usedCols.
GroupByItemToPB converts group by items to pb.
HandleBinaryLiteral wraps `expr` with to_binary or from_binary sig.
HasAssignSetVarFunc checks whether an expression contains SetVar function and assign a value.
HasGetSetVarFunc checks whether an expression contains SetVar/GetVar function.
IndexCol2Col finds the corresponding column of the IndexColumn in a column slice.
IndexInfo2Cols gets the corresponding []*Column of the indexInfo's []*IndexColumn, together with a []int containing their lengths.
IndexInfo2PrefixCols gets the corresponding []*Column of the indexInfo's []*IndexColumn, together with a []int containing their lengths.
InferType4ControlFuncs infer result type for builtin IF, IFNULL, NULLIF, CASEWHEN, COALESCE, LEAD and LAG.
InterpretVectorSearchExpr try to interpret a VectorSearch expression.
IsBinaryLiteral checks whether an expression is a binary literal.
IsDeferredFunctions checks whether the function is in DeferredFunctions.
IsEQCondFromIn checks if an expression is equal condition converted from `[not] in (subq)`.
IsFunctionSupported check if given function name is a builtin sql function.
IsImmutableFunc checks whether this expression only consists of foldable functions.
IsMutableEffectsExpr checks if expr contains function which is mutable or has side effects.
IsPushDownEnabled returns true if the input expr is not in the expr_pushdown_blacklist.
IsRuntimeConstExpr checks if a expr can be treated as a constant in **executor**.
IsValidCurrentTimestampExpr returns true if exprNode is a valid CurrentTimestamp expression.
LowerAlphaASCII only lowers alpha ascii.
LowerAlphaASCIIExcludeEscapeChar lower alpha ascii exclude escape char.
MaybeOverOptimized4PlanCache used to check whether an optimization can work for the statement when we enable the plan cache.
MergeSchema will merge two schema into one schema.
NewEvaluatorSuite creates an EvaluatorSuite to evaluate all the exprs.
NewFunction creates a new scalar function or constant via a constant folding.
NewFunctionBase creates a new scalar function with no constant folding.
NewFunctionInternal is similar to NewFunction, but do not return error, should only be used internally.
NewFunctionTryFold creates a new scalar function with trying constant folding.
NewFunctionWithInit creates a new scalar function with callback init function.
NewGroupingSets new a grouping sets from a slice of expression.
NewInt64Const stands for constant of a given number.
NewNull stands for null constant.
NewNullWithFieldType stands for null constant with specified fieldType.
NewOne stands for an unsigned number 1.
NewPBConverter creates a PbConverter.
NewPushDownContext returns a new PushDownContext.
NewPushDownContextFromSessionVars builds a new PushDownContext from session vars.
NewSchema returns a schema made by its parameter.
NewSignedOne stands for a signed number 1.
NewSignedZero stands for a signed number 0.
NewSQLDigestTextRetriever creates a new SQLDigestTextRetriever.
NewStrConst stands for constant of a given string.
NewUInt64Const stands for constant of a given number.
NewUInt64ConstWithFieldType stands for constant of a given number with specified fieldType.
NewValuesFunc creates a new values function.
NewZero stands for an unsigned number 0.
ParamMarkerExpression generate a getparam function expression.
ParseSimpleExpr parses simple expression string to Expression.
ParseSimpleExprWithTableInfo now is only used by some external repo like tiflow to make sure they are not break.
PBToExpr converts pb structure to expression.
PBToExprs converts pb structures to expressions.
PbTypeToFieldType converts tipb.FieldType to FieldType.
PopRowFirstArg pops the first element and returns the rest of row.
PosFromPositionExpr generates a position value from PositionExpr.
ProjectionBenefitsFromPushedDown evaluates if the expressions can improve performance when pushed down to TiKV Projections are not pushed down to tikv by default, thus we need to check strictly here to avoid potential performance degradation.
ProjectionExpressionsToPBList converts PhysicalProjection's expressions to tipb.Expr list for new plan.
PropagateConstant propagate constant values of deterministic predicates in a condition.
PropagateType propagates the type information to the `expr`.
PropConstOverOuterJoin propagate constant equal and column equal conditions over outer join.
PushDownExprs split the input exprs into pushed and remained, pushed include all the exprs that can be pushed down.
PushDownExprsWithExtraInfo split the input exprs into pushed and remained, pushed include all the exprs that can be pushed down.
PushDownNot pushes the `not` function down to the expression's arguments.
PutColumn releases a column buffer.
Quote produce a result that can be used as a properly escaped data value in an SQL statement.
RefineComparedConstant changes a non-integer constant argument to its ceiling or floor result by the given op.
ReHashCode is used after we change the argument in place.
RemoveDupExprs removes identical exprs.
RemoveMutableConst used to remove the `ParamMarker` and `DeferredExpr` in the `Constant` expr.
ResolveType4Between resolves eval type for between expression.
RestoreGbyExpression restore the new gby expression according to recorded idxes reference.
RollupGroupingSets roll up the given expressions, and iterate out a slice of grouping set expressions.
ScalarFuncs2Exprs converts []*ScalarFunction to []Expression.
SetBinFlagOrBinStr sets resTp to binary string if argTp is a binary string, if not, sets the binary flag of resTp to true if argTp has binary flag.
SetExprColumnInOperand is used to set columns in expr as InOperand.
SortByItemToPB converts order by items to pb.
SortColumns sort columns based on UniqueID.
SortedExplainExpressionList generates explain information for a list of expressions in order.
SortedExplainExpressionListIgnoreInlist generates explain information for a list of expressions in order.
SortedExplainNormalizedExpressionList is same like SortedExplainExpressionList, but use for generating normalized information.
SortedExplainNormalizedScalarFuncList is same like SortedExplainExpressionList, but use for generating normalized information.
SplitCNFItems splits CNF items.
SplitDNFItems splits DNF items.
StringifyExpressionsWithCtx turns a slice of expressions into string.
SubstituteCorCol2Constant will substitute correlated column to constant value which it contains.
TableInfo2SchemaAndNames converts the TableInfo to the schema and name slice.
ToPBFieldType converts *types.FieldType to *tipb.FieldType.
ToPBFieldTypeWithCheck converts *types.FieldType to *tipb.FieldType with checking the valid decimal for TiFlash.
TryPushCastIntoControlFunctionForHybridType try to push cast into control function for Hybrid Type.
ValidCompareConstantPredicate checks if the predicate is an expression like [column '>'|'>='|'<'|'<='|'=' constant].
ValidCompareConstantPredicateHelper checks if the predicate is a compare constant predicate, like "Column xxx Constant".
VecEvalBool does the same thing as EvalBool but it works in a vectorized manner.
Vectorizable checks whether a list of expressions can employ vectorized execution.
VectorizedExecute evaluates a list of expressions column by column and append their results to "output" Chunk.
VectorizedFilter applies a list of filters to a Chunk and returns a bool slice, which indicates whether a row is passed the filters.
VectorizedFilterConsiderNull applies a list of filters to a Chunk and returns two bool slices, `selected` indicates whether a row passed the filters, `isNull` indicates whether the result of the filter is null.
VerifyArgsWrapper verifies a function by its name and the count of the arguments.
WithAllowCastArray specifies whether to allow casting to an array type.
WithCastExprTo indicates that we need to the cast the generated expression to the target type.
WithInputSchemaAndNames specifies the input schema and names for the expression to build.
WithTableInfo specifies table meta for the expression to build.
WrapWithCastAsDecimal wraps `expr` with `cast` if the return type of expr is not type decimal, otherwise, returns `expr` directly.
WrapWithCastAsDuration wraps `expr` with `cast` if the return type of expr is not type duration, otherwise, returns `expr` directly.
WrapWithCastAsInt wraps `expr` with `cast` if the return type of expr is not type int, otherwise, returns `expr` directly.
WrapWithCastAsJSON wraps `expr` with `cast` if the return type of expr is not type json, otherwise, returns `expr` directly.
WrapWithCastAsReal wraps `expr` with `cast` if the return type of expr is not type real, otherwise, returns `expr` directly.
WrapWithCastAsString wraps `expr` with `cast` if the return type of expr is not type string, otherwise, returns `expr` directly.
WrapWithCastAsTime wraps `expr` with `cast` if the return type of expr is not same as type of the specified `tp` , otherwise, returns `expr` directly.
WrapWithCastAsVectorFloat32 wraps `expr` with `cast` if the return type of expr is not type VectorFloat32, otherwise, returns `expr` directly.

# Constants

ASCII is pure ASCII U+0000..U+007F.
CoercibilityCoercible is derived from a literal.
CoercibilityExplicit is derived from an explicit COLLATE clause.
CoercibilityIgnorable is derived from NULL or an expression that is derived from NULL.
CoercibilityImplicit is derived from a column or a stored routine parameter or local variable or cast() function.
CoercibilityNone is derived from the concatenation of two strings with different collations.
CoercibilityNumeric is derived from a numeric or temporal value.
CoercibilitySysconst is derived from a “system constant” (the string returned by functions such as USER() or VERSION()).
ConstNone indicates the expression is not a constant expression.
ConstOnlyInContext indicates the expression is only a constant for a same context.
ConstStrict indicates the expression is a constant expression.
EXTENDED is extended characters: U+0080..U+FFFF.
GLCmpStringAsDate Greatest/Least function compares string as 'yyyy-mm-dd' format.
GLCmpStringAsDatetime Greatest/Least function compares string as 'yyyy-mm-dd hh:mm:ss' format.
GLCmpStringDirectly Greatest and Least function compares string directly.
GLRetDate Greatest/Least function returns date type, 'yyyy-mm-dd'.
GLRetDatetime Greatest/Least function returns datetime type, 'yyyy-mm-dd hh:mm:ss'.
GLRetNoneTemporal Greatest/Least function returns non temporal time.
InternalFuncFromBinary accepts a string and returns another string decode in a given charset.
InternalFuncToBinary accepts a string and returns another string encoded in a given charset.
These are byte flags used for `HashCode()`.
Supported hash length of SHA-2 family.
Supported hash length of SHA-2 family.
Supported hash length of SHA-2 family.
Supported hash length of SHA-2 family.
Supported hash length of SHA-2 family.
UNICODE is ASCII | EXTENDED.

# Variables

AllowedPartition4BinaryOpMap store the operator for Binary Expr See https://dev.mysql.com/doc/refman/5.7/en/partitioning-limitations.html for more details.
AllowedPartition4UnaryOpMap store the operator for Unary Expr.
AllowedPartitionFuncMap stores functions which can be used in the partition expression.
BuildSimpleExpr builds a simple expression from an ast node.
CollationStrictness indicates the strictness of comparison of the collation.
CollationStrictnessGroup group collation by strictness.
DecodeKeyFromString is used to decode key by expressions.
DefaultExprPushDownBlacklist indicates the expressions which can not be pushed down to TiKV.
DisableFoldFunctions stores functions which prevent child scope functions from being constant folded.
EncodeIndexKeyFromRow is used to encode index key by expressions.
EncodeRecordKeyFromRow is used to encode record key by expressions.
Error instances.
Error instances.
Error instances.
Error instances.
Error instances.
Error instances.
All the exported errors are defined here:.
Error instances.
Error instances.
Error instances.
Error instances.
Error instances.
Error instances.
Error instances.
Error instances.
EvalSimpleAst evaluates a simple ast expression directly.
ExprPushDownBlackListReloadTimeStamp is used to record the last time when the push-down black list is reloaded.
IllegalFunctions4GeneratedColumns stores functions that is illegal for generated columns.
MaxPropagateColsCnt means the max number of columns that can participate propagation.
TryFoldFunctions stores functions which try to fold constant in child scope functions if without errors/warnings, otherwise, the child functions do not fold constant.
UnCacheableFunctions stores functions which can not be cached to plan cache.

# Structs

Assignment represents a set assignment in Update, such as Update t set c1 = hex(12), c2 = c3 where c2 = 1.
BuildOptions is used to provide optional settings to build an expression.
BuiltinGroupingImplSig grouping functions called by user is actually executed by this.
Column represents a column.
Constant stands for a constant value.
CorrelatedColumn stands for a column in a correlated sub query.
EvaluatorSuite is responsible for the evaluation of a list of expressions.
ExprCollation is a struct that store the collation related information.
Instruction contains content that used to replace the origin string.
ParamMarker indicates param provided by COM_STMT_EXECUTE.
ParamMarkerInPrepareChecker checks whether the given ast tree has paramMarker and is in prepare statement.
PbConverter supplies methods to convert TiDB expressions to TiPB.
PushDownContext is the context used for push down expressions.
ScalarFunction is the function that returns a value.
Schema stands for the row schema and unique key information get from input.
SQLDigestTextRetriever is used to find the normalized SQL statement text by SQL digests in statements_summary table.
VarAssignment represents a variable assignment in Set, such as set global a = 1.
VSInfo is an easy to use struct for interpreting a VectorSearch expression.

# Interfaces

CollationInfo contains all interfaces about dealing with collation.
Expression represents all scalar expression in SQL.
PropagateConstantSolver is a constant propagate solver.
SafeToShareAcrossSession indicates whether the expression can be shared across different sessions.
StringerWithCtx is the interface for expressions that can be stringified with context.
TraverseAction define the interface for action when traversing down an expression.
VecExpr contains all vectorized evaluation methods.

# Type aliases

AggFuncBuildContext is used to build an aggregation expression.
BuildContext is used to build an expression.
BuildOption is a function to apply optional settings.
CNFExprs stands for a CNF expression.
Coercibility values are used to check whether the collation of one item can be coerced to the collation of other.
CompareFunc defines the compare function prototype.
ConstLevel indicates the const level for an expression.
EvalContext is used to evaluate an expression.
GLCmpStringMode represents Greatest/Least integral string comparison mode.
GLRetTimeType represents Greatest/Least return time type.
GroupingExprs indicates one grouping-expressions inside a grouping set.
GroupingSet indicates one grouping set definition.
GroupingSets indicates the grouping sets definition.
KeyInfo stores the columns of one unique key or primary key.
OptionalEvalPropDesc is an alias of context.OptionalEvalPropDesc.
OptionalEvalPropKey is an alias of context.OptionalEvalPropKey.
OptionalEvalPropKeySet is an alias of context.OptionalEvalPropKeySet.
OptionalEvalPropProvider is an alias of context.OptionalEvalPropProvider.
ParamValues is used to store the values of params in context.
The Repertoire of a character set is the collection of characters in the set.
ScalarFunctionCallBack is the definition of callback of calling a newFunction.