![]() |
MySQL 9.5.0
Source Code Documentation
|
#include <item_cmpfunc.h>
Public Member Functions | |
| In_vector (uint elements) | |
| See Item_func_in::resolve_type() for why we need both count and used_count. More... | |
| virtual | ~In_vector ()=default |
| virtual bool | find_item (Item *item)=0 |
| Calls item->val_int() or item->val_str() etc. More... | |
| virtual Item * | create_item (MEM_ROOT *mem_root) const =0 |
| Create an instance of Item_{type} (e.g. More... | |
| virtual void | value_to_item (uint pos, Item *item) const =0 |
| Store the value at position pos into provided item object. More... | |
| virtual bool | compare_elems (uint pos1, uint pos2) const =0 |
| Compare values number pos1 and pos2 for equality. More... | |
| virtual bool | is_row_result () const |
| bool | fill (Item **items, uint item_count) |
| Fill the vector by evaluating the items passed as arguments. More... | |
| virtual void | cleanup () |
Public Attributes | |
| uint | m_used_size {0} |
| The actual size of the vector (NULL may be ignored) More... | |
Private Member Functions | |
| virtual bool | set (uint pos, Item *item)=0 |
| Evaluate item and set value into element "pos" of the vector. More... | |
| virtual void | sort_array ()=0 |
| Sort the IN-list array, so we can do efficient lookup with binary_search. More... | |
Private Attributes | |
| const uint | m_size |
| Size of the vector. More... | |
|
inlineexplicit |
See Item_func_in::resolve_type() for why we need both count and used_count.
|
virtualdefault |
|
inlinevirtual |
Reimplemented in In_vector_string.
|
pure virtual |
Compare values number pos1 and pos2 for equality.
Implemented in In_vector_string, In_vector_int, In_vector_time, In_vector_double, In_vector_decimal, and in_row.
Create an instance of Item_{type} (e.g.
Item_decimal) constant object which type allows it to hold an element of this vector without any conversions. The purpose of this function is to be able to get elements of this vector in form of Item_xxx constants without creating Item_xxx object for every array element you get (i.e. this implements "FlyWeight" pattern)
| mem_root | Where to allocate the Item. |
Implemented in in_row, In_vector_string, In_vector_int, in_datetime_as_longlong, In_vector_time, in_datetime, In_vector_double, and In_vector_decimal.
| bool In_vector::fill | ( | Item ** | items, |
| uint | item_count | ||
| ) |
Fill the vector by evaluating the items passed as arguments.
Note that null values are skipped so the vector may end up containing fewer elements than the number of items. The vector is sorted so that it can be used for binary search.
| items | Items to evaluate |
| item_count | Number of items |
|
pure virtual |
Calls item->val_int() or item->val_str() etc.
and then does binary_search if the value is non-null.
| item | to evaluate, and lookup in the IN-list. |
Implemented in In_vector_string, In_vector_int, In_vector_time, In_vector_double, In_vector_decimal, and in_row.
|
inlinevirtual |
Reimplemented in in_row.
|
privatepure virtual |
Evaluate item and set value into element "pos" of the vector.
| pos | element number in vector |
| item | item to evaluate |
Implemented in In_vector_string, In_vector_int, In_vector_time, in_datetime, In_vector_double, In_vector_decimal, and in_row.
|
privatepure virtual |
Sort the IN-list array, so we can do efficient lookup with binary_search.
Implemented in In_vector_string, In_vector_int, In_vector_time, In_vector_double, In_vector_decimal, and in_row.
|
pure virtual |
Store the value at position pos into provided item object.
| pos | Index of value to store |
| item | Constant item to store value into. The item must be of the same type that create_item() returns. |
Implemented in In_vector_string, In_vector_int, In_vector_time, In_vector_double, In_vector_decimal, and in_row.
|
private |
Size of the vector.
| uint In_vector::m_used_size {0} |
The actual size of the vector (NULL may be ignored)