#include <key_spec.h>
◆ Key_part_spec() [1/3]
◆ Key_part_spec() [2/3]
Key_part_spec::Key_part_spec |
( |
const char * |
column_name, |
|
|
Item * |
expression, |
|
|
enum_order |
order |
|
) |
| |
|
inline |
◆ Key_part_spec() [3/3]
◆ clone()
Construct a copy of this Key_part_spec.
field_name is copied by-pointer as it is known to never change. At the same time 'length' may be reset in mysql_prepare_create_table, and this is why we supply it with a copy.
- Returns
- If out of memory, 0 is returned and an error is set in THD.
◆ get_expression()
Item * Key_part_spec::get_expression |
( |
| ) |
const |
|
inline |
◆ get_field_name()
const char * Key_part_spec::get_field_name |
( |
| ) |
const |
|
inline |
◆ get_prefix_length()
uint Key_part_spec::get_prefix_length |
( |
| ) |
const |
|
inline |
◆ has_expression()
bool Key_part_spec::has_expression |
( |
| ) |
const |
|
inline |
- Return values
-
true | if this index has an expression. In that case, this a functional key part. |
false | if this index doesn't have an expression. In that case this key part references a normal column. |
◆ is_ascending()
bool Key_part_spec::is_ascending |
( |
| ) |
const |
|
inline |
- Return values
-
true | if this is an ascending index. |
false | if this is a descending index. |
◆ is_explicit()
bool Key_part_spec::is_explicit |
( |
| ) |
const |
|
inline |
- Return values
-
true | if the user explicitly specified the index direction when creating the index. |
false | if the user didn't specify the index direction. |
◆ operator==()
bool Key_part_spec::operator== |
( |
const Key_part_spec & |
other | ) |
const |
◆ resolve_expression()
bool Key_part_spec::resolve_expression |
( |
THD * |
thd | ) |
|
Resolve the expression that this key part contains.
Should only be called if has_expression() returns true.
- Parameters
-
- Return values
-
true | if an error occurred. |
false | on success. |
◆ set_name_and_prefix_length()
void Key_part_spec::set_name_and_prefix_length |
( |
const char * |
name, |
|
|
uint |
prefix_length |
|
) |
| |
Set the name and the prefix length of the column this key part references.
The supplied column name string should have a lifetime equal to or longer than this Key_part_spec
- Parameters
-
name | the new column that this key part points to. |
prefix_length | the prefix length of the index, or 0 if no length is specified. |
◆ m_expression
Item* Key_part_spec::m_expression |
|
private |
The indexed expression if this is a functional key part.
If this key part points to a "normal" column, m_expression is nullptr.
◆ m_field_name
const char* Key_part_spec::m_field_name |
|
private |
The name of the column that this key part points to.
◆ m_has_expression
bool Key_part_spec::m_has_expression |
|
private |
Whether this key part has an expression or not.
If so, this is a functional key part.
◆ m_is_ascending
const bool Key_part_spec::m_is_ascending |
|
private |
true <=> ascending, false <=> descending.
◆ m_is_explicit
const bool Key_part_spec::m_is_explicit |
|
private |
true <=> ASC/DESC is explicitly specified, false <=> implicit ASC
◆ m_prefix_length
uint Key_part_spec::m_prefix_length |
|
private |
The prefix length of this index.
The documentation for this class was generated from the following files: