MySQL 8.0.39
Source Code Documentation
ha_federated.cc File Reference
#include "storage/federated/ha_federated.h"
#include <mysql/plugin.h>
#include <stdlib.h>
#include <algorithm>
#include <string>
#include "lex_string.h"
#include "m_string.h"
#include "map_helpers.h"
#include "my_byteorder.h"
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_macros.h"
#include "my_psi_config.h"
#include "myisam.h"
#include "mysql/psi/mysql_memory.h"
#include "mysql/psi/mysql_mutex.h"
#include "sql/current_thd.h"
#include "sql/key.h"
#include "sql/mysqld.h"
#include "sql/sql_class.h"
#include "sql/sql_lex.h"
#include "sql/sql_servers.h"
#include "sql_common.h"
#include "template_utils.h"
#include "unsafe_string_append.h"

Macros

#define MYSQL_SERVER   1
 

Functions

static handlerfederated_create_handler (handlerton *hton, TABLE_SHARE *table, bool partitioned, MEM_ROOT *mem_root)
 
static int federated_commit (handlerton *hton, THD *thd, bool all)
 
static int federated_rollback (handlerton *hton, THD *thd, bool all)
 
static void init_federated_psi_keys (void)
 
static int federated_db_init (void *p)
 
static int federated_done (void *)
 
static bool append_ident (String *string, const char *name, size_t length, const char quote_char)
 Append identifiers to the string. More...
 
static int parse_url_error (TABLE *table, int error_num)
 
static int get_connection (MEM_ROOT *mem_root, FEDERATED_SHARE *share)
 
static int parse_url (MEM_ROOT *mem_root, FEDERATED_SHARE *share, TABLE *table, uint table_create_flag)
 
static bool emit_key_part_name (String *to, KEY_PART_INFO *part)
 
static bool emit_key_part_element (String *to, KEY_PART_INFO *part, bool needs_quotes, bool is_like, uchar *ptr, uint len)
 
static FEDERATED_SHAREget_share (const char *table_name, TABLE *table)
 
static int free_share (FEDERATED_SHARE *share)
 
 mysql_declare_plugin (federated)
 

Variables

static PSI_memory_key fe_key_memory_federated_share
 
static malloc_unordered_map< string, FEDERATED_SHARE * > federated_open_tables
 
mysql_mutex_t federated_mutex
 
static char ident_quote_char = '`'
 
static char value_quote_char = '\''
 
static const int bulk_padding = 64
 
static const uint sizeof_trailing_comma = sizeof(", ") - 1
 
static const uint sizeof_trailing_and = sizeof(" AND ") - 1
 
static const uint sizeof_trailing_where = sizeof(" WHERE ") - 1
 
static PSI_mutex_key fe_key_mutex_federated
 
static PSI_mutex_key fe_key_mutex_FEDERATED_SHARE_mutex
 
static PSI_mutex_info all_federated_mutexes []
 
static PSI_memory_info all_federated_memory []
 
struct st_mysql_storage_engine federated_storage_engine
 
 mysql_declare_plugin_end
 

Macro Definition Documentation

◆ MYSQL_SERVER

#define MYSQL_SERVER   1

Function Documentation

◆ append_ident()

static bool append_ident ( String string,
const char *  name,
size_t  length,
const char  quote_char 
)
static

Append identifiers to the string.

Parameters
[in,out]stringThe target string.
[in]nameIdentifier name
[in]lengthLength of identifier name in bytes
[in]quote_charQuote char to use for quoting identifier.
Returns
Operation Status
Return values
falseOK
trueThere was an error appending to the string.
Note
This function is based upon the append_identifier() function in sql_show.cc except that quoting always occurs.

◆ emit_key_part_element()

static bool emit_key_part_element ( String to,
KEY_PART_INFO part,
bool  needs_quotes,
bool  is_like,
uchar ptr,
uint  len 
)
static

◆ emit_key_part_name()

static bool emit_key_part_name ( String to,
KEY_PART_INFO part 
)
static

◆ federated_commit()

static int federated_commit ( handlerton hton,
THD thd,
bool  all 
)
static

◆ federated_create_handler()

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

◆ federated_db_init()

static int federated_db_init ( void *  p)
static

◆ federated_done()

static int federated_done ( void *  )
static

◆ federated_rollback()

static int federated_rollback ( handlerton hton,
THD thd,
bool  all 
)
static

◆ free_share()

static int free_share ( FEDERATED_SHARE share)
static

◆ get_connection()

static int get_connection ( MEM_ROOT mem_root,
FEDERATED_SHARE share 
)
static

◆ get_share()

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

◆ init_federated_psi_keys()

static void init_federated_psi_keys ( void  )
static

◆ mysql_declare_plugin()

mysql_declare_plugin ( federated  )

◆ parse_url()

static int parse_url ( MEM_ROOT mem_root,
FEDERATED_SHARE share,
TABLE table,
uint  table_create_flag 
)
static

◆ parse_url_error()

static int parse_url_error ( TABLE table,
int  error_num 
)
static

Variable Documentation

◆ all_federated_memory

PSI_memory_info all_federated_memory[]
static
Initial value:
= {
{&fe_key_memory_federated_share, "FEDERATED_SHARE",
#define PSI_DOCUMENT_ME
Definition: component_common.h:29
#define PSI_FLAG_ONLY_GLOBAL_STAT
Global stat only flag.
Definition: psi_bits.h:112
static PSI_memory_key fe_key_memory_federated_share
Definition: ha_federated.cc:414

◆ all_federated_mutexes

PSI_mutex_info all_federated_mutexes[]
static
Initial value:
=
{
{ &fe_key_mutex_FEDERATED_SHARE_mutex, "FEDERATED_SHARE::mutex", 0, 0, PSI_DOCUMENT_ME}
}
#define PSI_FLAG_SINGLETON
Singleton flag.
Definition: component_common.h:35
static PSI_mutex_key fe_key_mutex_federated
Definition: ha_federated.cc:444
static PSI_mutex_key fe_key_mutex_FEDERATED_SHARE_mutex
Definition: ha_federated.cc:444

◆ bulk_padding

const int bulk_padding = 64
static

◆ fe_key_memory_federated_share

PSI_memory_key fe_key_memory_federated_share
static

◆ fe_key_mutex_federated

PSI_mutex_key fe_key_mutex_federated
static

◆ fe_key_mutex_FEDERATED_SHARE_mutex

PSI_mutex_key fe_key_mutex_FEDERATED_SHARE_mutex
static

◆ federated_mutex

mysql_mutex_t federated_mutex

◆ federated_open_tables

malloc_unordered_map<string, FEDERATED_SHARE *> federated_open_tables
static

◆ federated_storage_engine

struct st_mysql_storage_engine federated_storage_engine
Initial value:
= {
#define MYSQL_HANDLERTON_INTERFACE_VERSION
Definition: plugin.h:701

◆ ident_quote_char

char ident_quote_char = '`'
static

◆ mysql_declare_plugin_end

mysql_declare_plugin_end

◆ sizeof_trailing_and

const uint sizeof_trailing_and = sizeof(" AND ") - 1
static

◆ sizeof_trailing_comma

const uint sizeof_trailing_comma = sizeof(", ") - 1
static

◆ sizeof_trailing_where

const uint sizeof_trailing_where = sizeof(" WHERE ") - 1
static

◆ value_quote_char

char value_quote_char = '\''
static