MySQL 8.0.39
Source Code Documentation
in_row Class Referencefinal

#include <item_cmpfunc.h>

Inheritance diagram for in_row:
[legend]

Public Member Functions

 in_row (MEM_ROOT *mem_root, uint elements, cmp_item_row *cmp)
 
bool is_row_result () const override
 
bool allocate (MEM_ROOT *mem_root, Item *lhs, uint arg_count)
 Allocate extra objects for evaluation. More...
 
bool find_item (Item *item) override
 Calls item->val_int() or item->val_str() etc. More...
 
bool compare_elems (uint pos1, uint pos2) const override
 Compare values number pos1 and pos2 for equality. More...
 
Item_basic_constantcreate_item (MEM_ROOT *) const override
 Create an instance of Item_{type} (e.g. More...
 
void value_to_item (uint, Item_basic_constant *) const override
 Store the value at position pos into provided item object. More...
 
- Public Member Functions inherited from in_vector
 in_vector (uint elements)
 See Item_func_in::resolve_type() for why we need both count and used_count. More...
 
virtual ~in_vector ()=default
 
bool fill (Item **items, uint item_count)
 Fill the vector by evaluating the items passed as arguments. More...
 
virtual void cleanup ()
 

Private Member Functions

void set (uint pos, Item *item) override
 
void sort_array () override
 Sort the IN-list array, so we can do efficient lookup with binary_search. More...
 

Private Attributes

unique_ptr_destroy_only< cmp_item_rowtmp
 
Mem_root_array< cmp_item_rowbase_objects
 
Mem_root_array< cmp_item_row * > base_pointers
 

Additional Inherited Members

- Public Attributes inherited from in_vector
uint m_used_size {0}
 The actual size of the vector (NULL may be ignored) More...
 

Constructor & Destructor Documentation

◆ in_row()

in_row::in_row ( MEM_ROOT mem_root,
uint  elements,
cmp_item_row cmp 
)

Member Function Documentation

◆ allocate()

bool in_row::allocate ( MEM_ROOT mem_root,
Item lhs,
uint  arg_count 
)

Allocate extra objects for evaluation.

Parameters
mem_rootMemory root for allocation.
lhsThe left-hand side object of the IN predicate.
arg_countNumber of arguments on the right-hand side of the predicate
Returns
false if success, true if error.

◆ compare_elems()

bool in_row::compare_elems ( uint  pos1,
uint  pos2 
) const
overridevirtual

Compare values number pos1 and pos2 for equality.

Implements in_vector.

◆ create_item()

Item_basic_constant * in_row::create_item ( MEM_ROOT mem_root) const
inlineoverridevirtual

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)

Parameters
mem_rootWhere to allocate the Item.

Implements in_vector.

◆ find_item()

bool in_row::find_item ( Item item)
overridevirtual

Calls item->val_int() or item->val_str() etc.

and then does binary_search if the value is non-null.

Parameters
itemto evaluate, and lookup in the IN-list.
Returns
true if evaluated value of the item was found.

Implements in_vector.

◆ is_row_result()

bool in_row::is_row_result ( ) const
inlineoverridevirtual

Reimplemented from in_vector.

◆ set()

void in_row::set ( uint  pos,
Item item 
)
overrideprivatevirtual

Implements in_vector.

◆ sort_array()

void in_row::sort_array ( )
overrideprivatevirtual

Sort the IN-list array, so we can do efficient lookup with binary_search.

Implements in_vector.

◆ value_to_item()

void in_row::value_to_item ( uint  pos,
Item_basic_constant item 
) const
inlineoverridevirtual

Store the value at position pos into provided item object.

Parameters
posIndex of value to store
itemConstant item to store value into. The item must be of the same type that create_item() returns.

Implements in_vector.

Member Data Documentation

◆ base_objects

Mem_root_array<cmp_item_row> in_row::base_objects
private

◆ base_pointers

Mem_root_array<cmp_item_row *> in_row::base_pointers
private

◆ tmp

unique_ptr_destroy_only<cmp_item_row> in_row::tmp
private

The documentation for this class was generated from the following files: