MySQL 8.0.29
Source Code Documentation
sort.cc File Reference
#include <sys/types.h>
#include <algorithm>
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_macros.h"
#include "storage/myisam/fulltext.h"
#include "storage/myisam/myisamdef.h"
#include <stddef.h>
#include "storage/myisam/queues.h"
#include "template_utils.h"

Macros

#define MERGEBUFF   15
 
#define MERGEBUFF2   31
 
#define MYF_RW   MYF(MY_NABP | MY_WME | MY_WAIT_IF_FULL)
 
#define DISK_BUFFER_SIZE   (IO_SIZE * 16)
 

Functions

void print_error (const char *fmt,...)
 
static ha_rows find_all_keys (MI_SORT_PARAM *info, uint keys, uchar **sort_keys, DYNAMIC_ARRAY *buffpek, int *maxbuffer, IO_CACHE *tempfile, IO_CACHE *tempfile_for_exceptions)
 
static int write_keys (MI_SORT_PARAM *info, uchar **sort_keys, uint count, BUFFPEK *buffpek, IO_CACHE *tempfile)
 
static int write_key (MI_SORT_PARAM *info, uchar *key, IO_CACHE *tempfile)
 
static int write_index (MI_SORT_PARAM *info, uchar **sort_keys, uint count)
 
static int merge_many_buff (MI_SORT_PARAM *info, uint keys, uchar **sort_keys, BUFFPEK *buffpek, int *maxbuffer, IO_CACHE *t_file)
 
static uint read_to_buffer (IO_CACHE *fromfile, BUFFPEK *buffpek, uint sort_length)
 
static int merge_buffers (MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file, IO_CACHE *to_file, uchar **sort_keys, BUFFPEK *lastbuff, BUFFPEK *Fb, BUFFPEK *Tb)
 
static int merge_index (MI_SORT_PARAM *, uint, uchar **, BUFFPEK *, int, IO_CACHE *)
 
static int flush_ft_buf (MI_SORT_PARAM *info)
 
static int write_keys_varlen (MI_SORT_PARAM *info, uchar **sort_keys, uint count, BUFFPEK *buffpek, IO_CACHE *tempfile)
 
static uint read_to_buffer_varlen (IO_CACHE *fromfile, BUFFPEK *buffpek, uint sort_length)
 
static int write_merge_key (MI_SORT_PARAM *info, IO_CACHE *to_file, uchar *key, uint sort_length, uint count)
 
static int write_merge_key_varlen (MI_SORT_PARAM *info, IO_CACHE *to_file, uchar *key, uint sort_length, uint count)
 
static int my_var_write (MI_SORT_PARAM *info, IO_CACHE *to_file, uchar *bufs)
 
int _create_index_by_sort (MI_SORT_PARAM *info, bool no_messages, ulonglong sortbuff_size)
 
void * thr_find_all_keys (void *arg)
 
int thr_write_keys (MI_SORT_PARAM *sort_param)
 

Macro Definition Documentation

◆ DISK_BUFFER_SIZE

#define DISK_BUFFER_SIZE   (IO_SIZE * 16)

◆ MERGEBUFF

#define MERGEBUFF   15

◆ MERGEBUFF2

#define MERGEBUFF2   31

◆ MYF_RW

#define MYF_RW   MYF(MY_NABP | MY_WME | MY_WAIT_IF_FULL)

Function Documentation

◆ _create_index_by_sort()

int _create_index_by_sort ( MI_SORT_PARAM info,
bool  no_messages,
ulonglong  sortbuff_size 
)

◆ find_all_keys()

static ha_rows find_all_keys ( MI_SORT_PARAM info,
uint  keys,
uchar **  sort_keys,
DYNAMIC_ARRAY buffpek,
int *  maxbuffer,
IO_CACHE tempfile,
IO_CACHE tempfile_for_exceptions 
)
static

◆ flush_ft_buf()

static int flush_ft_buf ( MI_SORT_PARAM info)
static

◆ merge_buffers()

static int merge_buffers ( MI_SORT_PARAM info,
uint  keys,
IO_CACHE from_file,
IO_CACHE to_file,
uchar **  sort_keys,
BUFFPEK lastbuff,
BUFFPEK Fb,
BUFFPEK Tb 
)
static

◆ merge_index()

static int merge_index ( MI_SORT_PARAM info,
uint  keys,
uchar **  sort_keys,
BUFFPEK buffpek,
int  maxbuffer,
IO_CACHE tempfile 
)
static

◆ merge_many_buff()

static int merge_many_buff ( MI_SORT_PARAM info,
uint  keys,
uchar **  sort_keys,
BUFFPEK buffpek,
int *  maxbuffer,
IO_CACHE t_file 
)
static

◆ my_var_write()

static int my_var_write ( MI_SORT_PARAM info,
IO_CACHE to_file,
uchar bufs 
)
inlinestatic

◆ print_error()

void print_error ( const char *  fmt,
  ... 
)

◆ read_to_buffer()

static uint read_to_buffer ( IO_CACHE fromfile,
BUFFPEK buffpek,
uint  sort_length 
)
static

◆ read_to_buffer_varlen()

static uint read_to_buffer_varlen ( IO_CACHE fromfile,
BUFFPEK buffpek,
uint  sort_length 
)
static

◆ thr_find_all_keys()

void * thr_find_all_keys ( void *  arg)

◆ thr_write_keys()

int thr_write_keys ( MI_SORT_PARAM sort_param)

◆ write_index()

static int write_index ( MI_SORT_PARAM info,
uchar **  sort_keys,
uint  count 
)
static

◆ write_key()

static int write_key ( MI_SORT_PARAM info,
uchar key,
IO_CACHE tempfile 
)
static

◆ write_keys()

static int write_keys ( MI_SORT_PARAM info,
uchar **  sort_keys,
uint  count,
BUFFPEK buffpek,
IO_CACHE tempfile 
)
static

◆ write_keys_varlen()

static int write_keys_varlen ( MI_SORT_PARAM info,
uchar **  sort_keys,
uint  count,
BUFFPEK buffpek,
IO_CACHE tempfile 
)
static

◆ write_merge_key()

static int write_merge_key ( MI_SORT_PARAM info,
IO_CACHE to_file,
uchar key,
uint  sort_length,
uint  count 
)
static

◆ write_merge_key_varlen()

static int write_merge_key_varlen ( MI_SORT_PARAM info,
IO_CACHE to_file,
uchar key,
uint  sort_length,
uint  count 
)
static