package
2.1.0-rc.2+incompatible
Repository: https://github.com/coderushing/tidb.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# Functions
AddInt64 adds int64 a and b if no overflow, otherwise returns error.
AddInteger adds uint64 a and int64 b and returns uint64 if no overflow error.
AddUint64 adds uint64 a and b if no overflow, else returns error.
AdjustYear is used for adjusting year and checking its validation.
AggFieldType aggregates field types for a multi-argument function like `IF`, `IFNULL`, `COALESCE` whose return type is determined by the arguments' FieldTypes.
AggregateEvalType aggregates arguments' EvalType of a multi-argument function.
CheckFsp checks whether fsp is in valid range.
CoerceDatum changes type.
CompareFloat64 returns an integer comparing the float64 x to y.
CompareInt64 returns an integer comparing the int64 x to y.
CompareString returns an integer comparing the string x to y.
CompareUint64 returns an integer comparing the uint64 x to y.
ComputePlus computes the result of a+b.
ConvertDatumToDecimal converts datum to decimal.
ConvertFloatToInt converts a float64 value to a int value.
ConvertFloatToUint converts a float value to an uint value.
ConvertIntToInt converts an int value to another int value of different precision.
ConvertIntToUint converts an int value to an uint value.
ConvertJSONToFloat casts JSON into float64.
ConvertJSONToInt casts JSON into int64.
ConvertUintToInt converts an uint value to an int value.
ConvertUintToUint converts an uint value to another uint value of different precision.
CopyDatum returns a new copy of the datum.
CopyRow deep copies a Datum slice.
CurrentTime returns current time with type tp.
DateDiff calculates number of days between two days.
DateFSP gets fsp from date string.
DatumsToString converts several datums to formatted string.
DatumsToStrNoErr converts some datums to a formatted string.
DecimalAdd adds two decimals, sets the result to 'to'.
DecimalDiv does division of two decimals.
DecimalMod does modulus of two decimals.
DecimalMul multiplies two decimals.
DecimalNeg reverses decimal's sign.
DecimalPeak returns the length of the encoded decimal.
DecimalSub subs one decimal from another, sets the result to 'to'.
DefaultCharsetForType returns the default charset/collation for mysql type.
DefaultParamTypeForValue returns the default FieldType for the parameterized value.
DefaultTypeForValue returns the default FieldType for the value.
DivInt64 divides int64 a with b, returns int64 if no overflow error.
DivIntWithUint divides int64 a with uint64 b, returns uint64 if no overflow error.
DivUintWithInt divides uint64 a with int64 b, returns uint64 if no overflow error.
EOFAsNil filtrates errors, If err is equal to io.EOF returns nil.
EqualDatums compare if a and b contains the same datum values.
ExtractDatetimeNum extracts time value number from datetime unit and format.
ExtractDurationNum extracts duration value number from duration unit and format.
ExtractTimeValue extracts time value from time unit and format.
FromDate makes a internal time representation from the given date.
FromGoTime translates time.Time to mysql time internal representation.
GetFormatType checks the type(Duration, Date or Datetime) of a format string.
GetFsp gets the fsp of a string.
InvOp2 returns an invalid operation error.
IsBinaryStr returns a boolean indicating whether the field type is a binary string type.
IsClockUnit returns true when unit is interval unit with hour, minute or second.
IsDateFormat returns true when the specified time format could contain only date.
IsNonBinaryStr returns a boolean indicating whether the field type is a non-binary string type.
IsString returns a boolean indicating whether the field type is a string type.
IsTemporalWithDate returns a boolean indicating whether the tp is time type with date.
IsTypeBlob returns a boolean indicating whether the tp is a blob type.
IsTypeChar returns a boolean indicating whether the tp is the char type like a string type or a varchar type.
IsTypeFractionable returns a boolean indicating whether the tp can has time fraction.
IsTypeNumeric returns a boolean indicating whether the tp is numeric type.
IsTypePrefixable returns a boolean indicating whether an index on a column with the tp can be defined with a prefix.
IsTypeTemporal checks if a type is a temporal type.
IsTypeTime returns a boolean indicating whether the tp is time type like datetime, date or timestamp.
IsTypeUnspecified returns a boolean indicating whether the tp is the Unspecified type.
IsTypeVarchar returns a boolean indicating whether the tp is the varchar type like a varstring type or a varchar type.
KindStr converts kind to a string.
MakeDatums creates datum slice from interfaces.
MaxMySQLTime returns Time with maximum mysql time type.
MaxValueDatum returns a datum represents max value.
MergeFieldType merges two MySQL type to a new type.
MinNotNullDatum returns a datum represents minimum not null value.
MulInt64 multiplies int64 a and b and returns int64 if no overflow error.
MulInteger multiplies uint64 a and int64 b, and returns uint64 if no overflow error.
MulUint64 multiplies uint64 a and b and returns uint64 if no overflow error.
NewBinaryLiteralDatum creates a new BinaryLiteral Datum for a BinaryLiteral value.
NewBinaryLiteralFromUint creates a new BinaryLiteral instance by the given uint value in BitEndian.
NewBitLiteral parses bit string as BitLiteral type.
NewBytesDatum creates a new Datum from a byte slice.
NewDatum creates a new Datum from an interface{}.
NewDecFromFloatForTest creates a MyDecimal from float, as it returns no error, it should only be used in test.
NewDecFromInt creates a MyDecimal from int.
NewDecFromStringForTest creates a MyDecimal from string, as it returns no error, it should only be used in test.
NewDecFromUint creates a MyDecimal from uint.
NewDecimalDatum creates a new Datum form a MyDecimal value.
NewDurationDatum creates a new Datum from a Duration value.
NewFieldType returns a FieldType, with a type and other information about field type.
NewFloat32Datum creates a new Datum from a float32 value.
NewFloat64Datum creates a new Datum from a float64 value.
NewHexLiteral parses hexadecimal string as HexLiteral type.
NewIntDatum creates a new Datum from an int64 value.
NewMaxOrMinDec returns the max or min value decimal for given precision and fraction.
NewMysqlBitDatum creates a new MysqlBit Datum for a BinaryLiteral value.
NewStringDatum creates a new Datum from a string.
NewTimeDatum creates a new Time from a Time value.
NewUintDatum creates a new Datum from an uint64 value.
NumberToDuration converts number to Duration.
ParseBitStr parses bit string.
ParseDate is a helper function wrapping ParseTime with date type.
ParseDateFormat parses a formatted date string and returns separated components.
ParseDateFromNum is a helper function wrapping ParseTimeFromNum with date type.
ParseDatetime is a helper function wrapping ParseTime with datetime type and default fsp.
ParseDatetimeFromNum is a helper function wrapping ParseTimeFromNum with datetime type and default fsp.
ParseDuration parses the time form a formatted string with a fractional seconds part, returns the duration type Time value.
ParseEnumName creates a Enum with item name.
ParseEnumValue creates a Enum with special number.
ParseFrac parses the input string according to fsp, returns the microsecond, and also a bool value to indice overflow.
ParseHexStr parses hexadecimal string literal.
ParseSetName creates a Set with name.
ParseSetValue creates a Set with special number.
ParseTime parses a formatted string with type tp and specific fsp.
ParseTimeFromFloatString is similar to ParseTime, except that it's used to parse a float converted string.
ParseTimeFromInt64 parses mysql time value from int64.
ParseTimeFromNum parses a formatted int64, returns the value which type is tp.
ParseTimestamp is a helper function wrapping ParseTime with timestamp type and default fsp.
ParseTimestampFromNum is a helper function wrapping ParseTimeFromNum with timestamp type and default fsp.
ParseYear parses a formatted string and returns a year number.
ProduceDecWithSpecifiedTp produces a new decimal according to `flen` and `decimal`.
ProduceFloatWithSpecifiedTp produces a new float64 according to `flen` and `decimal`.
ProduceStrWithSpecifiedTp produces a new string according to `flen` and `chs`.
Round rounds the argument f to dec decimal places.
RoundFloat rounds float val to the nearest integer value with float64 format, like MySQL Round function.
RoundFrac rounds fractional seconds precision with new fsp and returns a new one.
SetBinChsClnFlag sets charset, collation as 'binary' and adds binaryFlag to FieldType.
SortDatums sorts a slice of datum.
StrToDateTime converts str to MySQL DateTime.
StrToDuration converts str to Duration.
StrToFloat converts a string to a float64 at the best-effort.
StrToInt converts a string to an integer at the best-effort.
StrToUint converts a string to an unsigned integer at the best-effortt.
SubInt64 subtracts int64 a with b and returns int64 if no overflow error.
SubIntWithUint subtracts int64 a with uint64 b and returns uint64 if no overflow error.
SubUint64 subtracts uint64 a with b and returns uint64 if no overflow error.
SubUintWithInt subtracts uint64 a with int64 b and returns uint64 if no overflow error.
TimeFromDays Converts a day number to a date.
TimestampDiff returns t2 - t1 where t1 and t2 are date or datetime expressions.
ToString converts an interface to a string.
Truncate truncates the argument f to dec decimal places.
TruncateFloat tries to truncate f.
TruncateOverflowMySQLTime truncates d when it overflows, and return ErrTruncatedWrongVal.
TypeStr converts tp to a string.
TypeToStr converts a field to a string.
# Constants
Time format without fractional seconds precision.
DefaultFsp is the default digit of fractional seconds part.
constant values.
ETDatetime represents type DATETIME in evaluation.
ETDecimal represents type DECIMAL in evaluation.
ETDuration represents type DURATION in evaluation.
ETInt represents type INT in evaluation.
ETJson represents type JSON in evaluation.
ETReal represents type REAL in evaluation.
ETString represents type STRING in evaluation.
ETTimestamp represents type TIMESTAMP in evaluation.
Used for BIT / HEX literals.
Kind constants.
Kind constants.
Kind constants.
Kind constants.
Kind constants.
Kind constants.
Kind constants.
Used for BIT table column values.
Kind constants.
Kind constants.
Kind constants.
Kind constants.
Kind constants.
Kind constants.
Kind constants.
Kind constants.
Kind constants.
Kind constants.
MaxDuration is the maximum for duration.
MaxFsp is the maximum digit of fractional seconds part.
MaxTime is the maximum for mysql time type.
MaxYear is the maximum for mysql year type.
MinFsp is the minimum digit of fractional seconds part.
MinTime is the minimum for mysql time type.
MinYear is the minimum for mysql year type.
ModeHalfEven rounds normally.
Truncate just truncates the decimal.
MyDecimalStructSize is the struct size of MyDecimal.
Time format without fractional seconds precision.
TimeFSPFormat is time format with fractional seconds precision.
TimeMaxHour is the max hour for mysql time type.
TimeMaxMinute is the max minute for mysql time type.
TimeMaxSecond is the max second for mysql time type.
TimeMaxValue is the maximum value for mysql time type.
TimeMaxValueSeconds is the maximum second value for mysql time type.
UnspecifiedFsp is the unspecified fractional seconds part.
UnspecifiedLength is unspecified length.
VarStorageLen indicates this column is a variable length column.
ZeroDateStr is the string representation of a zero date.
ZeroDatetimeStr is the string representation of a zero datetime.
# Variables
BoundTimezone is the timezone for min and max timestamp.
ErrBadNumber is return when parsing an invalid binary decimal number.
ErrCastAsSignedOverflow is returned when positive out-of-range integer, and convert to it's negative complement.
ErrCastNegIntAsUnsigned is returned when a negative integer be casted to an unsigned int.
ErrDataTooLong is returned when converts a string value that is longer than field type length.
ErrDivByZero is return when do division by 0.
ErrIllegalValueForType is returned when value of type is illegal.
Portable analogs of some common call errors.
ErrInvalidDefault is returned when meet a invalid default value.
Portable analogs of some common call errors.
Portable analogs of some common call errors.
Portable analogs of some common call errors.
ErrMBiggerThanD is returned when precision less than the scale.
ErrOverflow is returned when data is out of range for a field type.
ErrTooBigDisplayWidth is return when display width out of range for column.
ErrTooBigFieldLength is return when column length too big for column.
ErrTooBigPrecision is returned when type DECIMAL/NUMERIC precision is bigger than mysql.MaxDecimalWidth.
ErrTooBigScale is returned when type DECIMAL/NUMERIC scale is bigger than mysql.MaxDecimalScale.
ErrTooBigSet is returned when too many strings for column.
ErrTruncated is returned when data has been truncated during conversion.
ErrTruncatedWrongVal is returned when data has been truncated during conversion.
Portable analogs of some common call errors.
ErrWarnDataOutOfRange is returned when the value in a numeric column that is outside the permissible range of the column data type.
ErrWrongFieldSpec is return when incorrect column specifier for column.
Portable analogs of some common call errors.
MaxDatetime is the maximum for mysql datetime type.
MaxTimestamp is the maximum for mysql timestamp type.
MinDatetime is the minimum for mysql datetime type.
MinTimestamp is the minimum for mysql timestamp type.
MonthNames lists names of months, which are used in builtin time function `monthname`.
SignedLowerBound indicates the min int64 values of different mysql types.
SignedUpperBound indicates the max int64 values of different mysql types.
UnsignedUpperBound indicates the max uint64 values of different mysql types.
WeekdayNames lists names of weekdays, which are used in builtin time function `dayname`.
ZeroBinaryLiteral is a BinaryLiteral literal with zero value.
ZeroDate is the zero value for date Time.
ZeroDatetime is the zero value for datetime Time.
ZeroDuration is the zero value for Duration type.
ZeroTime is the zero value for TimeInternal type.
ZeroTimestamp is the zero value for timestamp Time.
# Structs
Datum is a data box holds different kind of data.
Duration is the type for MySQL TIME type.
Enum is for MySQL enum type.
FieldType records field type information.
MyDecimal represents a decimal value.
MysqlTime is the internal struct type for Time.
Set is for MySQL Set type.
Time is the struct for handling datetime, timestamp and date.
# Type aliases
BinaryLiteral is the internal type for storing bit / hex literal type.
BitLiteral is the bit literal type.
EvalType indicates the specified types that arguments and result of a built-in function should be.
HexLiteral is the hex literal type.
RoundMode is the type for round mode.