MySQL 8.3.0
Source Code Documentation
ref_row_iterators.cc File Reference
#include <string.h>
#include <sys/types.h>
#include <algorithm>
#include <cassert>
#include <iterator>
#include <memory>
#include <string>
#include <utility>
#include "ft_global.h"
#include "mem_root_deque.h"
#include "my_alloc.h"
#include "my_base.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_table_map.h"
#include "sql/debug_sync.h"
#include "sql/handler.h"
#include "sql/item.h"
#include "sql/item_func.h"
#include "sql/item_sum.h"
#include "sql/iterators/basic_row_iterators.h"
#include "sql/iterators/ref_row_iterators.h"
#include "sql/iterators/row_iterator.h"
#include "sql/iterators/timing_iterator.h"
#include "sql/join_optimizer/access_path.h"
#include "sql/key.h"
#include "sql/key_spec.h"
#include "sql/mysqld.h"
#include "sql/opt_trace.h"
#include "sql/opt_trace_context.h"
#include "sql/psi_memory_key.h"
#include "sql/range_optimizer/path_helpers.h"
#include "sql/range_optimizer/range_optimizer.h"
#include "sql/sql_bitmap.h"
#include "sql/sql_class.h"
#include "sql/sql_const.h"
#include "sql/sql_executor.h"
#include "sql/sql_lex.h"
#include "sql/sql_opt_exec_shared.h"
#include "sql/sql_optimizer.h"
#include "sql/sql_select.h"
#include "sql/system_variables.h"
#include "sql/table.h"
#include "sql/visible_fields.h"
#include "template_utils.h"

Functions

static pair< uchar *, key_part_mapFindKeyBufferAndMap (const Index_lookup *ref)
 
static bool init_index (TABLE *table, handler *file, uint idx, bool sorted)
 Initialize an index scan. More...
 
static ulonglong get_exact_record_count (QEP_TAB *qep_tab, uint table_count, int *error)
 Get exact count of rows in all tables. More...
 

Function Documentation

◆ FindKeyBufferAndMap()

static pair< uchar *, key_part_map > FindKeyBufferAndMap ( const Index_lookup ref)
inlinestatic

◆ get_exact_record_count()

static ulonglong get_exact_record_count ( QEP_TAB qep_tab,
uint  table_count,
int *  error 
)
static

Get exact count of rows in all tables.

When this is called, at least one table's SE doesn't include HA_COUNT_ROWS_INSTANT.

Parameters
qep_tabList of qep_tab in this JOIN.
table_countCount of qep_tab in the JOIN.
error[out] Return any possible error. Else return 0
Returns
Cartesian product of count of the rows in all tables if success 0 if error.
Note
The "error" parameter is required for the sake of testcases like the one in innodb-wl6742.test:272. Earlier if an error was raised by ha_records, it wasn't handled by get_exact_record_count. Instead it was just allowed to go to the execution phase, where end_send_group would see the same error and raise it.

But with the new function 'end_send_count' in the execution phase, such an error should be properly returned so that it can be raised.

◆ init_index()

static bool init_index ( TABLE table,
handler file,
uint  idx,
bool  sorted 
)
static

Initialize an index scan.

Parameters
tablethe table to read
filethe handler to initialize
idxthe index to use
sorteduse the sorted order of the index
Return values
trueif an error occurred
falseon success