MySQL 8.4.3
Source Code Documentation
sql_test.cc File Reference
#include "my_config.h"
#include <float.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <functional>
#include "keycache.h"
#include "lex_string.h"
#include "m_string.h"
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_list.h"
#include "my_macros.h"
#include "my_sys.h"
#include "my_thread_local.h"
#include "mysql/psi/mysql_mutex.h"
#include "mysql/strings/m_ctype.h"
#include "prealloced_array.h"
#include "sql/events.h"
#include "sql/field.h"
#include "sql/item.h"
#include "sql/join_optimizer/access_path.h"
#include "sql/key.h"
#include "sql/keycaches.h"
#include "sql/mysqld.h"
#include "sql/mysqld_thd_manager.h"
#include "sql/opt_explain.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_opt_exec_shared.h"
#include "sql/sql_optimizer.h"
#include "sql/sql_select.h"
#include "sql/sql_show.h"
#include "sql/sql_test.h"
#include "sql/system_variables.h"
#include "sql/table.h"
#include "sql/table_cache.h"
#include "sql_string.h"
#include <malloc.h>

Classes

struct  TABLE_LOCK_INFO
 
class  DL_commpare
 

Typedefs

typedef Prealloced_array< TABLE_LOCK_INFO, 20 > Saved_locks_array
 

Functions

void print_where (const THD *thd, const Item *cond, const char *info, enum_query_type query_type)
 
void TEST_join (JOIN *join)
 
void print_keyuse_array (THD *thd, Opt_trace_context *trace, const Key_use_array *keyuse_array)
 
void print_plan (JOIN *join, uint idx, double record_count, double read_time, double current_read_time, const char *info)
 Print the current state during query optimization. More...
 
static int dl_compare (const TABLE_LOCK_INFO *a, const TABLE_LOCK_INFO *b)
 

Variables

const char * lock_descriptions [TL_WRITE_ONLY+1]
 

Typedef Documentation

◆ Saved_locks_array

Function Documentation

◆ dl_compare()

static int dl_compare ( const TABLE_LOCK_INFO a,
const TABLE_LOCK_INFO b 
)
inlinestatic

◆ print_keyuse_array()

void print_keyuse_array ( THD thd,
Opt_trace_context trace,
const Key_use_array keyuse_array 
)

◆ print_plan()

void print_plan ( JOIN join,
uint  idx,
double  record_count,
double  read_time,
double  current_read_time,
const char *  info 
)

Print the current state during query optimization.

Parameters
joinpointer to the structure providing all context info for the query
idxlength of the partial QEP in 'join->positions' also an index in the array 'join->best_ref'
record_countestimate for the number of records returned by the best partial plan
read_timethe cost of the best partial plan. If a complete plan is printed (join->best_read is set), this argument is ignored.
current_read_timethe accumulated cost of the current partial plan
infocomment string to appear above the printout

This function prints to the log file DBUG_FILE the members of 'join' that are used during query optimization (join->positions, join->best_positions, and join->best_ref) and few other related variables (read_time, record_count). Useful to trace query optimizer functions.

◆ print_where()

void print_where ( const THD thd,
const Item cond,
const char *  info,
enum_query_type  query_type 
)

◆ TEST_join()

void TEST_join ( JOIN join)

Variable Documentation

◆ lock_descriptions

const char* lock_descriptions[TL_WRITE_ONLY+1]
Initial value:
= {
"No lock",
nullptr,
"Low priority read lock",
"Shared read lock",
"High priority read lock",
"Read lock without concurrent inserts",
"Write lock that allows other writers",
nullptr,
"Concurrent insert lock",
nullptr,
"Low priority write lock",
"High priority write lock",
"Highest priority write lock"}