Module tidb_query_datatype::codec::mysql::decimal[][src]

Structs

Decimal

Decimal represents a decimal value.

Enums

Res
RoundMode

Constants

DECIMAL_STRUCT_SIZE

DECIMAL_STRUCT_SIZEis the struct size of Decimal.

DEFAULT_DIV_FRAC_INCR
DIGITS_PER_WORD
DIG_2_BYTES
DIG_MASK
FRAC_MAX
MAX_FRACTION
NOT_FIXED_DEC
WORD_BASE
WORD_BUF_LEN
WORD_MAX
WORD_SIZE

Traits

DecimalDatumPayloadChunkEncoder
DecimalDecoder
DecimalEncoder

Functions

add

add adds a and b and carry, stores the sum and new carry.

calc_sub_carry

calculate the carry for lhs - rhs, returns the carry and needed temporary results for beginning a subtraction.

count_leading_zeroes

count_leading_zeroes returns the number of leading zeroes that can be removed from int.

count_trailing_zeroes

count_trailing_zeroes returns the number of trailing zeroes that can be removed from fraction.

dec_encoded_len

Return the first encoded decimal’s length.

do_add

add lhs to rhs.

do_div_mod
do_div_mod_impl
do_mul

do_mul multiplies two decimals.

do_sub

subtract rhs from lhs when lhs.negative=rhs.negative.

first_non_digit

Get the first non-digit ascii char in bs from start_idx.

fix_word_cnt_err

fix_word_cnt_err limits word count in word_buf_len.

max_decimal

Get the max possible decimal with giving precision and fraction digit count. The prec should >= frac_cnt.

max_or_min_dec

max_or_min_dec(NewMaxOrMinDec in tidb) returns the max or min value decimal for given precision and fraction. The prec should >= frac_cnt.

read_word
sub

sub subtracts rhs and carry from lhs, store the diff and new carry.

sub2

sub2 subtracts rhs and carry from lhs, stores the diff and new carry. the new carry may be 2.

Type Definitions

SubTmp