mirror of
https://github.com/MariaDB/server.git
synced 2026-05-04 14:15:33 +02:00
WL#3914: Additonal accessors required to compile InnoDB as a plugin storage engine
Add more accessors to MySQL internals in mysql/plugin.h, for storage
engine plugins.
Add some accessors specific to the InnoDB storage engine, to allow
InnoDB to be compiled as a plugin (without MYSQL_SERVER). InnoDB
has additional requirements, due to its foreign key support, etc.
include/m_string.h:
Add structure tag to LEX_STRING definition, so that it can be referred
to by forward declarations. Allow struct st_mysql_lex_string to be
defined here, or in mysql/plugin.h.
include/my_global.h:
Define INNODB_COMPATIBILITY_HOOKS unconditionally; it brackets
some definitions needed for the InnoDB storage engine plugin
which do not belong in our general plugin interface.
include/mysql/plugin.h:
Additional accessors for MySQL internals:
- Full definition of MYSQL_LEX_STRING (identical to LEX_STRING from
m_string.h)
- Full definition of MYSQL_XID (binary compatible with XID from
handler.h)
- mysql_tmpfile(), creates a temporary file in mysqld's tmpdir
- thd_killed(), to check killed state of connection
- thd_alloc() and similar allocation functions
- thd_get_xid(), to get XID of connection's transaction
- mysql_query_cache_invalidate4, to invalidate a table's query cache entries
sql/handler.h:
Use MYSQL_XIDDATASIZE definition from mysql/plugin.h, to avoid redundant
definitions
sql/log.cc:
Add definitions for two InnoDB compatibility hooks:
- mysql_bin_log_file(), to get log filename
- mysql_bin_log_file_pos, to get position in file
These are defined only if INNODB_COMPATIBILITY_HOOKS is defined;
they are needed by the InnoDB plugin, but aren't part of the general
plugin interface. They are declared in ha_innodb.h for InnoDB's
use.
sql/mysql_priv.h:
Expose some server internals when INNODB_COMPATIBILITY_HOOKS is
defined, so that InnoDB can be built as a plugin when MYSQL_SERVER
is not defined.
Move make_lex_string inside THD class.
sql/sql_cache.cc:
Add definiton of mysql_query_cache_invalidate4(), a part of the
plugin API (mysql/plugin.h).
sql/sql_class.cc:
Add definitions for several accessor functions which form part
of the plugin API (mysql/plugin.h):
- mysql_tmpfile()
- thd_alloc() and friends
- thd_make_lex_string()
- thd_get_xid()
Add definitons for accessor functions which InnoDB requires,
but which are not part of the plugin interface:
- thd_charset()
- thd_query()
- thd_slave_thread()
- thd_non_transactional_update()
- thd_binlog_format()
Move definition of make_lex_string() from sql_show.cc into THD class
sql/sql_class.h:
Remove LEX_STRING_make(), and move make_lex_string() from sql_show.cc inside THD
class.
sql/sql_parse.cc:
Use thd->make_lex_string() instead of thd->LEX_STRING_make()
sql/sql_show.cc:
Move make_lex_string() inside THD class
storage/innobase/handler/ha_innodb.cc:
Call thd_make_lex_string() instead of make_lex_string().
This commit is contained in:
parent
aa6565cef7
commit
bd8b9746bf
12 changed files with 387 additions and 60 deletions
|
|
@ -2175,20 +2175,6 @@ void calc_sum_of_all_status(STATUS_VAR *to)
|
|||
}
|
||||
|
||||
|
||||
LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str,
|
||||
const char* str, uint length,
|
||||
bool allocate_lex_string)
|
||||
{
|
||||
MEM_ROOT *mem= thd->mem_root;
|
||||
if (allocate_lex_string)
|
||||
if (!(lex_str= (LEX_STRING *)thd->alloc(sizeof(LEX_STRING))))
|
||||
return 0;
|
||||
lex_str->str= strmake_root(mem, str, length);
|
||||
lex_str->length= length;
|
||||
return lex_str;
|
||||
}
|
||||
|
||||
|
||||
/* INFORMATION_SCHEMA name */
|
||||
LEX_STRING INFORMATION_SCHEMA_NAME= { C_STRING_WITH_LEN("information_schema")};
|
||||
|
||||
|
|
@ -5194,10 +5180,10 @@ int make_schema_select(THD *thd, SELECT_LEX *sel,
|
|||
We have to make non const db_name & table_name
|
||||
because of lower_case_table_names
|
||||
*/
|
||||
make_lex_string(thd, &db, INFORMATION_SCHEMA_NAME.str,
|
||||
INFORMATION_SCHEMA_NAME.length, 0);
|
||||
make_lex_string(thd, &table, schema_table->table_name,
|
||||
strlen(schema_table->table_name), 0);
|
||||
thd->make_lex_string(&db, INFORMATION_SCHEMA_NAME.str,
|
||||
INFORMATION_SCHEMA_NAME.length, 0);
|
||||
thd->make_lex_string(&table, schema_table->table_name,
|
||||
strlen(schema_table->table_name), 0);
|
||||
if (schema_table->old_format(thd, schema_table) || /* Handle old syntax */
|
||||
!sel->add_table_to_list(thd, new Table_ident(thd, db, table, 0),
|
||||
0, 0, TL_READ))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue