MySQL 9.1.0
Source Code Documentation
ha_tina.cc File Reference
#include "storage/csv/ha_tina.h"
#include <fcntl.h>
#include <mysql/plugin.h>
#include <mysql/psi/mysql_file.h>
#include <algorithm>
#include "m_string.h"
#include "map_helpers.h"
#include "my_byteorder.h"
#include "my_dbug.h"
#include "my_psi_config.h"
#include "mysql/psi/mysql_memory.h"
#include "nulls.h"
#include "sql/derror.h"
#include "sql/field.h"
#include "sql/sql_class.h"
#include "sql/sql_lex.h"
#include "sql/system_variables.h"
#include "sql/table.h"
#include "template_utils.h"

Macros

#define META_BUFFER_SIZE
 
#define TINA_CHECK_HEADER   254
 
#define BLOB_MEMROOT_ALLOC_SIZE   8192
 
#define CSV_EXT   ".CSV"
 
#define CSN_EXT   ".CSN"
 
#define CSM_EXT   ".CSM"
 

Functions

static TINA_SHAREget_share (const char *table_name, TABLE *table)
 
static int free_share (TINA_SHARE *share)
 
static int read_meta_file (File meta_file, ha_rows *rows)
 
static int write_meta_file (File meta_file, ha_rows rows, bool dirty)
 
void tina_get_status (void *param, int concurrent_insert)
 
void tina_update_status (void *param)
 
bool tina_check_status (void *param)
 
static handlertina_create_handler (handlerton *hton, TABLE_SHARE *table, bool partitioned, MEM_ROOT *mem_root)
 
static bool tina_is_supported_system_table (const char *db, const char *table_name, bool is_sql_layer_system_table)
 Check if the given db.tablename is a system table for this SE. More...
 
static void init_tina_psi_keys (void)
 
static int tina_init_func (void *p)
 
static int tina_done_func (void *)
 
static my_off_t find_eoln_buff (Transparent_file *data_buff, my_off_t begin, my_off_t end, int *eoln_len)
 
 mysql_declare_plugin (csv)
 

Variables

mysql_mutex_t tina_mutex
 
static unique_ptr< collation_unordered_multimap< string, TINA_SHARE * > > tina_open_tables
 
static PSI_memory_key csv_key_memory_tina_share
 
static PSI_memory_key csv_key_memory_blobroot
 
static PSI_memory_key csv_key_memory_tina_set
 
static PSI_memory_key csv_key_memory_row
 
static PSI_mutex_key csv_key_mutex_tina
 
static PSI_mutex_key csv_key_mutex_TINA_SHARE_mutex
 
static PSI_mutex_info all_tina_mutexes []
 
static PSI_file_key csv_key_file_metadata
 
static PSI_file_key csv_key_file_data
 
static PSI_file_key csv_key_file_update
 
static PSI_file_info all_tina_files []
 
static PSI_memory_info all_tina_memory []
 
static const char * ha_tina_exts [] = {CSV_EXT, CSM_EXT, NullS}
 
struct st_mysql_storage_engine csv_storage_engine
 
 mysql_declare_plugin_end
 

Macro Definition Documentation

◆ BLOB_MEMROOT_ALLOC_SIZE

#define BLOB_MEMROOT_ALLOC_SIZE   8192

◆ CSM_EXT

#define CSM_EXT   ".CSM"

◆ CSN_EXT

#define CSN_EXT   ".CSN"

◆ CSV_EXT

#define CSV_EXT   ".CSV"

◆ META_BUFFER_SIZE

#define META_BUFFER_SIZE
Value:
sizeof(uchar) + sizeof(uchar) + sizeof(ulonglong) + sizeof(ulonglong) + \
sizeof(ulonglong) + sizeof(ulonglong) + sizeof(uchar)
unsigned long long int ulonglong
Definition: my_inttypes.h:56
unsigned char uchar
Definition: my_inttypes.h:52

◆ TINA_CHECK_HEADER

#define TINA_CHECK_HEADER   254

Function Documentation

◆ find_eoln_buff()

static my_off_t find_eoln_buff ( Transparent_file data_buff,
my_off_t  begin,
my_off_t  end,
int *  eoln_len 
)
static

◆ free_share()

static int free_share ( TINA_SHARE share)
static

◆ get_share()

static TINA_SHARE * get_share ( const char *  table_name,
TABLE table 
)
static

◆ init_tina_psi_keys()

static void init_tina_psi_keys ( void  )
static

◆ mysql_declare_plugin()

mysql_declare_plugin ( csv  )

◆ read_meta_file()

static int read_meta_file ( File  meta_file,
ha_rows rows 
)
static

◆ tina_check_status()

bool tina_check_status ( void *  param)

◆ tina_create_handler()

static handler * tina_create_handler ( handlerton hton,
TABLE_SHARE table,
bool  partitioned,
MEM_ROOT mem_root 
)
static

◆ tina_done_func()

static int tina_done_func ( void *  )
static

◆ tina_get_status()

void tina_get_status ( void *  param,
int  concurrent_insert 
)

◆ tina_init_func()

static int tina_init_func ( void *  p)
static

◆ tina_is_supported_system_table()

static bool tina_is_supported_system_table ( const char *  db,
const char *  table_name,
bool  is_sql_layer_system_table 
)
static

Check if the given db.tablename is a system table for this SE.

Parameters
dbdatabase name.
table_nametable name to check.
is_sql_layer_system_tableif the supplied db.table_name is a SQL layer system table.
Return values
trueGiven db.table_name is supported system table.
falseGiven db.table_name is not a supported system table.

◆ tina_update_status()

void tina_update_status ( void *  param)

◆ write_meta_file()

static int write_meta_file ( File  meta_file,
ha_rows  rows,
bool  dirty 
)
static

Variable Documentation

◆ all_tina_files

PSI_file_info all_tina_files[]
static
Initial value:
= {
{&csv_key_file_metadata, "metadata", 0, 0, PSI_DOCUMENT_ME},
{&csv_key_file_update, "update", 0, 0, PSI_DOCUMENT_ME}}
#define PSI_DOCUMENT_ME
Definition: component_common.h:29
static PSI_file_key csv_key_file_update
Definition: ha_tina.cc:134
static PSI_file_key csv_key_file_metadata
Definition: ha_tina.cc:133
static PSI_file_key csv_key_file_data
Definition: ha_tina.cc:133

◆ all_tina_memory

PSI_memory_info all_tina_memory[]
static
Initial value:
= {
{&csv_key_memory_Transparent_file, "Transparent_file", 0, 0,
#define PSI_FLAG_ONLY_GLOBAL_STAT
Global stat only flag.
Definition: psi_bits.h:112
static PSI_memory_key csv_key_memory_row
Definition: ha_tina.cc:122
static PSI_memory_key csv_key_memory_tina_share
Definition: ha_tina.cc:119
static PSI_memory_key csv_key_memory_blobroot
Definition: ha_tina.cc:120
static PSI_memory_key csv_key_memory_tina_set
Definition: ha_tina.cc:121
PSI_memory_key csv_key_memory_Transparent_file
Definition: transparent_file.cc:30

◆ all_tina_mutexes

PSI_mutex_info all_tina_mutexes[]
static
Initial value:
= {
{&csv_key_mutex_TINA_SHARE_mutex, "TINA_SHARE::mutex", 0, 0,
#define PSI_FLAG_SINGLETON
Singleton flag.
Definition: component_common.h:35
static PSI_mutex_key csv_key_mutex_tina
Definition: ha_tina.cc:126
static PSI_mutex_key csv_key_mutex_TINA_SHARE_mutex
Definition: ha_tina.cc:126

◆ csv_key_file_data

PSI_file_key csv_key_file_data
static

◆ csv_key_file_metadata

PSI_file_key csv_key_file_metadata
static

◆ csv_key_file_update

PSI_file_key csv_key_file_update
static

◆ csv_key_memory_blobroot

PSI_memory_key csv_key_memory_blobroot
static

◆ csv_key_memory_row

PSI_memory_key csv_key_memory_row
static

◆ csv_key_memory_tina_set

PSI_memory_key csv_key_memory_tina_set
static

◆ csv_key_memory_tina_share

PSI_memory_key csv_key_memory_tina_share
static

◆ csv_key_mutex_tina

PSI_mutex_key csv_key_mutex_tina
static

◆ csv_key_mutex_TINA_SHARE_mutex

PSI_mutex_key csv_key_mutex_TINA_SHARE_mutex
static

◆ csv_storage_engine

struct st_mysql_storage_engine csv_storage_engine
Initial value:
= {
#define MYSQL_HANDLERTON_INTERFACE_VERSION
Definition: plugin.h:704

◆ ha_tina_exts

const char* ha_tina_exts[] = {CSV_EXT, CSM_EXT, NullS}
static

◆ mysql_declare_plugin_end

mysql_declare_plugin_end

◆ tina_mutex

mysql_mutex_t tina_mutex

◆ tina_open_tables

unique_ptr<collation_unordered_multimap<string, TINA_SHARE *> > tina_open_tables
static