MySQL 8.0.39
Source Code Documentation
|
A key part specification. More...
#include <parse_tree_nodes.h>
Public Member Functions | |
PT_key_part_specification (Item *expression, enum_order order) | |
Constructor for a functional key part. More... | |
PT_key_part_specification (const LEX_CSTRING &column_name, enum_order order, int prefix_length) | |
Constructor for a "normal" key part. More... | |
bool | contextualize (Parse_context *pc) override |
Contextualize this key part specification. More... | |
Item * | get_expression () const |
Get the indexed expression. More... | |
enum_order | get_order () const |
bool | is_explicit () const |
bool | has_expression () const |
LEX_CSTRING | get_column_name () const |
Get the column that this key part points to. More... | |
int | get_prefix_length () const |
Public Member Functions inherited from Parse_tree_node_tmpl< Context > | |
virtual | ~Parse_tree_node_tmpl ()=default |
bool | is_contextualized () const |
virtual bool | contextualize (Context *pc) |
Do all context-sensitive things and mark the node as contextualized. More... | |
void | error (Context *pc, const POS &pos) const |
syntax_error() function replacement for deferred reporting of syntax errors More... | |
void | error (Context *pc, const POS &pos, const char *msg) const |
syntax_error() function replacement for deferred reporting of syntax errors More... | |
void | errorf (Context *pc, const POS &pos, const char *format,...) const |
syntax_error() function replacement for deferred reporting of syntax errors More... | |
Private Types | |
typedef Parse_tree_node | super |
Private Attributes | |
Item * | m_expression |
The indexed expression in case this is a functional key part. More... | |
enum_order | m_order |
The direction of the index. More... | |
LEX_CSTRING | m_column_name |
The name of the column that this key part indexes. More... | |
int | m_prefix_length |
If this is greater than zero, it represents how many bytes of the column that is indexed. More... | |
Additional Inherited Members | |
Public Types inherited from Parse_tree_node_tmpl< Context > | |
typedef Context | context_t |
Static Public Member Functions inherited from Parse_tree_node_tmpl< Context > | |
static void * | operator new (size_t size, MEM_ROOT *mem_root, const std::nothrow_t &arg=std::nothrow) noexcept |
static void | operator delete (void *ptr, size_t size) |
static void | operator delete (void *, MEM_ROOT *, const std::nothrow_t &) noexcept |
Protected Member Functions inherited from Parse_tree_node_tmpl< Context > | |
Parse_tree_node_tmpl () | |
A key part specification.
This can either be a "normal" key part (a key part that points to a column), or this can be a functional key part (a key part that points to an expression).
|
private |
PT_key_part_specification::PT_key_part_specification | ( | Item * | expression, |
enum_order | order | ||
) |
Constructor for a functional key part.
expression | The expression to index. |
order | The direction of the index. |
PT_key_part_specification::PT_key_part_specification | ( | const LEX_CSTRING & | column_name, |
enum_order | order, | ||
int | prefix_length | ||
) |
Constructor for a "normal" key part.
That is a key part that points to a column and not an expression.
column_name | The column name that this key part points to. |
order | The direction of the index. |
prefix_length | How many bytes or characters this key part should index, or zero if it should index the entire column. |
|
override |
Contextualize this key part specification.
This will also call itemize on the indexed expression if this is a functional key part.
pc | The parse context |
true | on error |
false | on success |
|
inline |
Get the column that this key part points to.
This is only valid if this key part isn't a functional index. The caller must thus check the return value of has_expression() before calling this function.
|
inline |
Get the indexed expression.
The caller must ensure that has_expression() returns true before calling this.
|
inline |
|
inline |
|
inline |
true | if the key part contains an expression (and thus is a functional key part). |
false | if the key part doesn't contain an expression. |
|
inline |
true | if the user explicitly specified a direction (asc/desc). |
false | if the user didn't explicitly specify a direction. |
|
private |
The name of the column that this key part indexes.
|
private |
The indexed expression in case this is a functional key part.
Only valid if has_expression() returns true.
|
private |
The direction of the index.
|
private |
If this is greater than zero, it represents how many bytes of the column that is indexed.
Note that for non-binary columns (VARCHAR, TEXT etc), this is the number of characters.