MySQL 8.0.40
Source Code Documentation
|
#include <tree.h>
Public Types | |
enum | leaf_color { BLACK , RED } |
Public Member Functions | |
bool | maybe_null () const |
SEL_ROOT * | release_next_key_part () |
Convenience function for removing the next_key_part. More... | |
void | set_next_key_part (SEL_ROOT *next_key_part_arg) |
Convenience function for changing next_key_part, including updating the use_count. More... | |
SEL_ARG ()=default | |
SEL_ARG (SEL_ARG &) | |
SEL_ARG (Field *, const uchar *, const uchar *, bool asc) | |
SEL_ARG (Field *field, uint8 part, uchar *min_value, uchar *max_value, uint8 min_flag, uint8 max_flag, bool maybe_flag, bool asc, ha_rkey_function gis_flag) | |
~SEL_ARG () | |
Note that almost all SEL_ARGs are created on the MEM_ROOT, so this destructor will only rarely be called. More... | |
bool | is_same (const SEL_ARG *arg) const |
returns true if a range predicate is equal. More... | |
void | merge_flags (SEL_ARG *arg) |
void | maybe_smaller () |
bool | is_null_interval () |
int | cmp_min_to_min (const SEL_ARG *arg) const |
int | cmp_min_to_max (const SEL_ARG *arg) const |
int | cmp_max_to_max (const SEL_ARG *arg) const |
int | cmp_max_to_min (const SEL_ARG *arg) const |
SEL_ARG * | clone_and (SEL_ARG *arg, MEM_ROOT *mem_root) |
SEL_ARG * | clone_first (SEL_ARG *arg, MEM_ROOT *mem_root) |
SEL_ARG * | clone_last (SEL_ARG *arg, MEM_ROOT *mem_root) |
SEL_ARG * | clone (RANGE_OPT_PARAM *param, SEL_ARG *new_parent, SEL_ARG **next) |
bool | copy_min (SEL_ARG *arg) |
bool | copy_max (SEL_ARG *arg) |
void | copy_min_to_min (SEL_ARG *arg) |
void | copy_min_to_max (SEL_ARG *arg) |
void | copy_max_to_min (SEL_ARG *arg) |
void | set_gis_index_read_function (const enum ha_rkey_function rkey_func) |
Set spatial index range scan parameters. More... | |
int | store_min_value (uint length, uchar **min_key, uint min_key_flag) |
int | store_max_value (uint length, uchar **max_key, uint max_key_flag) |
void | store_min_max_values (uint length, uchar **min_key, uint min_flag, uchar **max_key, uint max_flag, int *min_part, int *max_part) |
Helper function for storing min/max values of SEL_ARG taking into account key part's order. More... | |
void | store_next_min_max_keys (KEY_PART *key, uchar **cur_min_key, uint *cur_min_flag, uchar **cur_max_key, uint *cur_max_flag, int *min_part, int *max_part) |
Helper function for storing min/max keys of next SEL_ARG taking into account key part's order. More... | |
SEL_ARG * | rb_insert (SEL_ARG *leaf) |
SEL_ARG * | first () |
This gives the first SEL_ARG in the interval list, and the minimal element in the red-black tree. More... | |
const SEL_ARG * | first () const |
SEL_ARG * | last () |
void | make_root () |
SEL_ARG ** | parent_ptr () |
bool | is_singlepoint () const |
uint | get_min_flag () |
Return correct min_flag. More... | |
uint | get_max_flag () |
Return correct max_flag. More... | |
Public Attributes | |
uint8 | min_flag {0} |
uint8 | max_flag {0} |
bool | maybe_flag {false} |
maybe_flag signals that this range is AND-ed with some unknown range (a MAYBE_KEY node). More... | |
uint8 | part {0} |
enum ha_rkey_function | rkey_func_flag |
The rtree index interval to scan, undefined unless SEL_ARG::min_flag == GEOM_FLAG. More... | |
Field * | field {nullptr} |
uchar * | min_value |
uchar * | max_value |
SEL_ARG * | left |
SEL_ARG * | right |
SEL_ARG * | next |
SEL_ARG * | prev |
SEL_ARG * | parent {nullptr} |
SEL_ROOT * | next_key_part {nullptr} |
enum SEL_ARG::leaf_color | color |
bool | is_ascending {true} |
true - ASC order, false - DESC More... | |
Friends | |
SEL_ARG * | rb_delete_fixup (SEL_ARG *root, SEL_ARG *key, SEL_ARG *par) |
int | test_rb_tree (SEL_ARG *element, SEL_ARG *parent) |
enum SEL_ARG::leaf_color |
|
default |
SEL_ARG::SEL_ARG | ( | SEL_ARG & | arg | ) |
SEL_ARG::SEL_ARG | ( | Field * | field, |
uint8 | part, | ||
uchar * | min_value, | ||
uchar * | max_value, | ||
uint8 | min_flag, | ||
uint8 | max_flag, | ||
bool | maybe_flag, | ||
bool | asc, | ||
ha_rkey_function | gis_flag | ||
) |
|
inline |
Note that almost all SEL_ARGs are created on the MEM_ROOT, so this destructor will only rarely be called.
SEL_ARG * SEL_ARG::clone | ( | RANGE_OPT_PARAM * | param, |
SEL_ARG * | new_parent, | ||
SEL_ARG ** | next | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
SEL_ARG * SEL_ARG::first | ( | ) |
This gives the first SEL_ARG in the interval list, and the minimal element in the red-black tree.
const SEL_ARG * SEL_ARG::first | ( | ) | const |
|
inline |
Return correct max_flag.
For DESC key parts min flag should be used as max flag, but in order to be checked correctly, min flag should be flipped as code doesn't expect e.g NEAR_MIN in max flag.
|
inline |
Return correct min_flag.
For DESC key parts max flag should be used as min flag, but in order to be checked correctly, max flag should be flipped as code doesn't expect e.g NEAR_MAX in min flag.
|
inline |
|
inline |
returns true if a range predicate is equal.
Use all_same() to check for equality of all the predicates on this keypart.
|
inline |
SEL_ARG * SEL_ARG::last | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Convenience function for removing the next_key_part.
The typical use for this function is to disconnect the next_key_part from the root, send it to key_and() or key_or(), and then connect the result of that function back to the SEL_ARG using set_next_key_part().
|
inline |
Set spatial index range scan parameters.
This object will be used to do spatial index range scan after this call.
rkey_func | The scan function to perform. It must be one of the spatial index specific scan functions. |
|
inline |
Convenience function for changing next_key_part, including updating the use_count.
The argument is allowed to be nullptr.
next_key_part_arg | New value for next_key_part. |
|
inline |
Helper function for storing min/max values of SEL_ARG taking into account key part's order.
|
inline |
Helper function for storing min/max keys of next SEL_ARG taking into account key part's order.
enum SEL_ARG::leaf_color SEL_ARG::color |
bool SEL_ARG::is_ascending {true} |
true - ASC order, false - DESC
SEL_ARG* SEL_ARG::left |
uint8 SEL_ARG::max_flag {0} |
uchar * SEL_ARG::max_value |
bool SEL_ARG::maybe_flag {false} |
maybe_flag signals that this range is AND-ed with some unknown range (a MAYBE_KEY node).
This means that the range could be smaller than what it would otherwise denote; e.g., a range such as
(0 < x < 3) AND x=( SELECT ... )
could in reality be e.g. (1 < x < 2), depending on what the subselect returns (and we don't know that when planning), but it could never be bigger.
FIXME: It's unclear if this is really kept separately per SEL_ARG or is meaningful only at the root node, and thus should be moved to the SEL_ROOT. Most code seems to assume the latter, but a few select places, non-root nodes appear to be modified.
uint8 SEL_ARG::min_flag {0} |
uchar* SEL_ARG::min_value |
SEL_ARG* SEL_ARG::next |
uint8 SEL_ARG::part {0} |
SEL_ARG * SEL_ARG::prev |
SEL_ARG * SEL_ARG::right |
enum ha_rkey_function SEL_ARG::rkey_func_flag |
The rtree index interval to scan, undefined unless SEL_ARG::min_flag == GEOM_FLAG.