MySQL 8.0.37
Source Code Documentation
HashJoinChunk Class Reference

#include <hash_join_chunk.h>

Public Member Functions

 HashJoinChunk ()=default
 
 HashJoinChunk (HashJoinChunk &&other)
 
 HashJoinChunk (const HashJoinChunk &obj)=delete
 
HashJoinChunkoperator= (HashJoinChunk &&other)
 
 ~HashJoinChunk ()
 
bool Init (const pack_rows::TableCollection &tables, bool uses_match_flags)
 Initialize this HashJoinChunk. More...
 
ha_rows num_rows () const
 
bool WriteRowToChunk (String *buffer, bool matched)
 Write a row to the HashJoinChunk. More...
 
bool LoadRowFromChunk (String *buffer, bool *matched)
 Read a row from the HashJoinChunk and put it in the record buffer. More...
 
bool Rewind ()
 Flush the file buffer, and prepare the file for reading. More...
 

Private Attributes

pack_rows::TableCollection m_tables
 
ha_rows m_num_rows {0}
 
IO_CACHE m_file
 
bool m_uses_match_flags {false}
 

Constructor & Destructor Documentation

◆ HashJoinChunk() [1/3]

HashJoinChunk::HashJoinChunk ( )
default

◆ HashJoinChunk() [2/3]

HashJoinChunk::HashJoinChunk ( HashJoinChunk &&  other)

◆ HashJoinChunk() [3/3]

HashJoinChunk::HashJoinChunk ( const HashJoinChunk obj)
delete

◆ ~HashJoinChunk()

HashJoinChunk::~HashJoinChunk ( )

Member Function Documentation

◆ Init()

bool HashJoinChunk::Init ( const pack_rows::TableCollection tables,
bool  uses_match_flags 
)

Initialize this HashJoinChunk.

Parameters
tablesThe tables to store row data from. Which column we store in the chunk file is determined by each tables read set.
uses_match_flagsWhether each row should be prefixed with a match flag, saying whether the row had a matching row.
Returns
true if the initialization failed.

◆ LoadRowFromChunk()

bool HashJoinChunk::LoadRowFromChunk ( String buffer,
bool *  matched 
)

Read a row from the HashJoinChunk and put it in the record buffer.

The function will read a row from file on disk and put it in the record buffers (table->record[0]) in the provided tables. The file on disk should already be pointing to the start of a row.

Parameters
buffera buffer that is used when copying data from the chunk file to the tables. Note that any existing data in "buffer" is overwritten.
[out]matchedwhether this row has seen a matching row from the other input. The flag is only restored if 'm_uses_match_flags' is set, and if the row comes from the probe input.
Return values
trueon error.

◆ num_rows()

ha_rows HashJoinChunk::num_rows ( ) const
inline
Returns
the number of rows in this HashJoinChunk

◆ operator=()

HashJoinChunk & HashJoinChunk::operator= ( HashJoinChunk &&  other)

◆ Rewind()

bool HashJoinChunk::Rewind ( )

Flush the file buffer, and prepare the file for reading.

Return values
trueon error

◆ WriteRowToChunk()

bool HashJoinChunk::WriteRowToChunk ( String buffer,
bool  matched 
)

Write a row to the HashJoinChunk.

Read the row that lies in the record buffer (record[0]) of the given tables and write it out to the underlying file. If the QEP_TAB signals that the row ID should be kept, it is also written out. Note that TABLE::read_set is used to signal which columns that should be written to the chunk.

Parameters
buffera buffer that is used when copying data from the tables to the chunk file. Note that any existing data in "buffer" is overwritten.
matchedwhether this row has seen a matching row from the other input. The flag is only written if 'm_uses_match_flags' is set, and if the row comes from the probe input.
Return values
trueon error.

Member Data Documentation

◆ m_file

IO_CACHE HashJoinChunk::m_file
private

◆ m_num_rows

ha_rows HashJoinChunk::m_num_rows {0}
private

◆ m_tables

pack_rows::TableCollection HashJoinChunk::m_tables
private

◆ m_uses_match_flags

bool HashJoinChunk::m_uses_match_flags {false}
private

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