Commit 1c27a050 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-19818 Reuse new I_S table definition helper classes for TokuDB

parent 9561b0b4
SHOW CREATE TABLE INFORMATION_SCHEMA.TOKUDB_BACKGROUND_JOB_STATUS;
Table Create Table
TokuDB_background_job_status CREATE TEMPORARY TABLE `TokuDB_background_job_status` (
`id` bigint(0) NOT NULL DEFAULT 0,
`database_name` varchar(256) NOT NULL DEFAULT '',
`table_name` varchar(256) NOT NULL DEFAULT '',
`job_type` varchar(256) NOT NULL DEFAULT '',
`job_params` varchar(256) NOT NULL DEFAULT '',
`scheduler` varchar(32) NOT NULL DEFAULT '',
`scheduled_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`started_time` datetime DEFAULT NULL,
`status` varchar(1024) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.TOKUDB_FILE_MAP;
Table Create Table
TokuDB_file_map CREATE TEMPORARY TABLE `TokuDB_file_map` (
`dictionary_name` varchar(256) NOT NULL DEFAULT '',
`internal_file_name` varchar(256) NOT NULL DEFAULT '',
`table_schema` varchar(256) NOT NULL DEFAULT '',
`table_name` varchar(256) NOT NULL DEFAULT '',
`table_dictionary_name` varchar(256) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.TOKUDB_FRACTAL_TREE_BLOCK_MAP;
Table Create Table
TokuDB_fractal_tree_block_map CREATE TEMPORARY TABLE `TokuDB_fractal_tree_block_map` (
`dictionary_name` varchar(256) NOT NULL DEFAULT '',
`internal_file_name` varchar(256) NOT NULL DEFAULT '',
`checkpoint_count` bigint(0) NOT NULL DEFAULT 0,
`blocknum` bigint(0) NOT NULL DEFAULT 0,
`offset` bigint(0) DEFAULT NULL,
`size` bigint(0) DEFAULT NULL,
`table_schema` varchar(256) NOT NULL DEFAULT '',
`table_name` varchar(256) NOT NULL DEFAULT '',
`table_dictionary_name` varchar(256) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.TOKUDB_FRACTAL_TREE_INFO;
Table Create Table
TokuDB_fractal_tree_info CREATE TEMPORARY TABLE `TokuDB_fractal_tree_info` (
`dictionary_name` varchar(256) NOT NULL DEFAULT '',
`internal_file_name` varchar(256) NOT NULL DEFAULT '',
`bt_num_blocks_allocated` bigint(0) NOT NULL DEFAULT 0,
`bt_num_blocks_in_use` bigint(0) NOT NULL DEFAULT 0,
`bt_size_allocated` bigint(0) NOT NULL DEFAULT 0,
`bt_size_in_use` bigint(0) NOT NULL DEFAULT 0,
`table_schema` varchar(256) NOT NULL DEFAULT '',
`table_name` varchar(256) NOT NULL DEFAULT '',
`table_dictionary_name` varchar(256) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.TOKUDB_LOCK_WAITS;
Table Create Table
TokuDB_lock_waits CREATE TEMPORARY TABLE `TokuDB_lock_waits` (
`requesting_trx_id` bigint(0) NOT NULL DEFAULT 0,
`blocking_trx_id` bigint(0) NOT NULL DEFAULT 0,
`lock_waits_dname` varchar(256) NOT NULL DEFAULT '',
`lock_waits_key_left` varchar(256) NOT NULL DEFAULT '',
`lock_waits_key_right` varchar(256) NOT NULL DEFAULT '',
`lock_waits_start_time` bigint(0) NOT NULL DEFAULT 0,
`lock_waits_table_schema` varchar(256) NOT NULL DEFAULT '',
`lock_waits_table_name` varchar(256) NOT NULL DEFAULT '',
`lock_waits_table_dictionary_name` varchar(256) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.TOKUDB_LOCKS;
Table Create Table
TokuDB_locks CREATE TEMPORARY TABLE `TokuDB_locks` (
`locks_trx_id` bigint(0) NOT NULL DEFAULT 0,
`locks_mysql_thread_id` bigint(0) NOT NULL DEFAULT 0,
`locks_dname` varchar(256) NOT NULL DEFAULT '',
`locks_key_left` varchar(256) NOT NULL DEFAULT '',
`locks_key_right` varchar(256) NOT NULL DEFAULT '',
`locks_table_schema` varchar(256) NOT NULL DEFAULT '',
`locks_table_name` varchar(256) NOT NULL DEFAULT '',
`locks_table_dictionary_name` varchar(256) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.TOKUDB_TRX;
Table Create Table
TokuDB_trx CREATE TEMPORARY TABLE `TokuDB_trx` (
`trx_id` bigint(0) NOT NULL DEFAULT 0,
`trx_mysql_thread_id` bigint(0) NOT NULL DEFAULT 0,
`trx_time` bigint(0) NOT NULL DEFAULT 0
) ENGINE=MEMORY DEFAULT CHARSET=utf8
--tokudb --plugin-load-add=$HA_TOKUDB_SO --loose-tokudb-check-jemalloc=0
package My::Suite::TokuDB_bugs;
use File::Basename;
@ISA = qw(My::Suite);
# Ensure we can run the TokuDB tests even if hugepages are enabled
$ENV{TOKU_HUGE_PAGES_OK}=1;
#return "Not run for embedded server" if $::opt_embedded_server;
return "No TokuDB engine" unless $ENV{HA_TOKUDB_SO} or $::mysqld_variables{tokudb};
sub is_default { not $::opt_embedded_server }
bless { };
SHOW CREATE TABLE INFORMATION_SCHEMA.TOKUDB_BACKGROUND_JOB_STATUS;
SHOW CREATE TABLE INFORMATION_SCHEMA.TOKUDB_FILE_MAP;
SHOW CREATE TABLE INFORMATION_SCHEMA.TOKUDB_FRACTAL_TREE_BLOCK_MAP;
SHOW CREATE TABLE INFORMATION_SCHEMA.TOKUDB_FRACTAL_TREE_INFO;
SHOW CREATE TABLE INFORMATION_SCHEMA.TOKUDB_LOCK_WAITS;
SHOW CREATE TABLE INFORMATION_SCHEMA.TOKUDB_LOCKS;
SHOW CREATE TABLE INFORMATION_SCHEMA.TOKUDB_TRX;
......@@ -56,11 +56,17 @@ st_mysql_information_schema trx_information_schema = {
MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION
};
using ::Show::Column;
using ::Show::SLonglong;
using ::Show::CEnd;
using ::Show::Varchar;
using ::Show::Datetime;
ST_FIELD_INFO trx_field_info[] = {
{"trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{"trx_mysql_thread_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{"trx_time", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE}
Column("trx_id", SLonglong(0), NOT_NULL),
Column("trx_mysql_thread_id", SLonglong(0), NOT_NULL),
Column("trx_time", SLonglong(0), NOT_NULL),
CEnd()
};
struct trx_extra_t {
......@@ -152,16 +158,16 @@ st_mysql_information_schema lock_waits_information_schema = {
};
ST_FIELD_INFO lock_waits_field_info[] = {
{"requesting_trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{"blocking_trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{"lock_waits_dname", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"lock_waits_key_left", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"lock_waits_key_right", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"lock_waits_start_time", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{"lock_waits_table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"lock_waits_table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"lock_waits_table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE}
Column("requesting_trx_id", SLonglong(0), NOT_NULL),
Column("blocking_trx_id", SLonglong(0), NOT_NULL),
Column("lock_waits_dname", Varchar(256), NOT_NULL),
Column("lock_waits_key_left", Varchar(256), NOT_NULL),
Column("lock_waits_key_right", Varchar(256), NOT_NULL),
Column("lock_waits_start_time", SLonglong(0), NOT_NULL),
Column("lock_waits_table_schema", Varchar(256), NOT_NULL),
Column("lock_waits_table_name", Varchar(256), NOT_NULL),
Column("lock_waits_table_dictionary_name", Varchar(256), NOT_NULL),
CEnd()
};
struct lock_waits_extra_t {
......@@ -293,16 +299,16 @@ st_mysql_information_schema locks_information_schema = {
MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION
};
ST_FIELD_INFO locks_field_info[] = {
{"locks_trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{"locks_mysql_thread_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{"locks_dname", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"locks_key_left", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"locks_key_right", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"locks_table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"locks_table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"locks_table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE}
ST_FIELD_INFO locks_field_info[] = {
Column("locks_trx_id", SLonglong(0), NOT_NULL),
Column("locks_mysql_thread_id", SLonglong(0), NOT_NULL),
Column("locks_dname", Varchar(256), NOT_NULL),
Column("locks_key_left", Varchar(256), NOT_NULL),
Column("locks_key_right", Varchar(256), NOT_NULL),
Column("locks_table_schema", Varchar(256), NOT_NULL),
Column("locks_table_name", Varchar(256), NOT_NULL),
Column("locks_table_dictionary_name", Varchar(256), NOT_NULL),
CEnd()
};
struct locks_extra_t {
......@@ -434,12 +440,12 @@ st_mysql_information_schema file_map_information_schema = {
};
ST_FIELD_INFO file_map_field_info[] = {
{"dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"internal_file_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE}
Column("dictionary_name", Varchar(256), NOT_NULL),
Column("internal_file_name", Varchar(256), NOT_NULL),
Column("table_schema", Varchar(256), NOT_NULL),
Column("table_name", Varchar(256), NOT_NULL),
Column("table_dictionary_name", Varchar(256), NOT_NULL),
CEnd()
};
int report_file_map(TABLE* table, THD* thd) {
......@@ -581,16 +587,16 @@ st_mysql_information_schema fractal_tree_info_information_schema = {
};
ST_FIELD_INFO fractal_tree_info_field_info[] = {
{"dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"internal_file_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"bt_num_blocks_allocated", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{"bt_num_blocks_in_use", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{"bt_size_allocated", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{"bt_size_in_use", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{"table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE}
Column("dictionary_name", Varchar(256), NOT_NULL),
Column("internal_file_name", Varchar(256), NOT_NULL),
Column("bt_num_blocks_allocated", SLonglong(0), NOT_NULL),
Column("bt_num_blocks_in_use", SLonglong(0), NOT_NULL),
Column("bt_size_allocated", SLonglong(0), NOT_NULL),
Column("bt_size_in_use", SLonglong(0), NOT_NULL),
Column("table_schema", Varchar(256), NOT_NULL),
Column("table_name", Varchar(256), NOT_NULL),
Column("table_dictionary_name", Varchar(256), NOT_NULL),
CEnd()
};
int report_fractal_tree_info_for_db(
......@@ -793,16 +799,16 @@ st_mysql_information_schema fractal_tree_block_map_information_schema = {
};
ST_FIELD_INFO fractal_tree_block_map_field_info[] = {
{"dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"internal_file_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"checkpoint_count", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{"blocknum", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{"offset", 0, MYSQL_TYPE_LONGLONG, 0, MY_I_S_MAYBE_NULL, NULL, SKIP_OPEN_TABLE },
{"size", 0, MYSQL_TYPE_LONGLONG, 0, MY_I_S_MAYBE_NULL, NULL, SKIP_OPEN_TABLE },
{"table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE}
Column("dictionary_name", Varchar(256), NOT_NULL),
Column("internal_file_name", Varchar(256), NOT_NULL),
Column("checkpoint_count", SLonglong(0), NOT_NULL),
Column("blocknum", SLonglong(0), NOT_NULL),
Column("offset", SLonglong(0), NULLABLE),
Column("size", SLonglong(0), NULLABLE),
Column("table_schema", Varchar(256), NOT_NULL),
Column("table_name", Varchar(256), NOT_NULL),
Column("table_dictionary_name", Varchar(256), NOT_NULL),
CEnd()
};
struct report_fractal_tree_block_map_iterator_extra_t {
......@@ -1089,16 +1095,16 @@ st_mysql_information_schema background_job_status_information_schema = {
};
ST_FIELD_INFO background_job_status_field_info[] = {
{"id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{"database_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"job_type", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"job_params", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"scheduler", 32, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"scheduled_time", 0, MYSQL_TYPE_DATETIME, 0, 0, NULL, SKIP_OPEN_TABLE },
{"started_time", 0, MYSQL_TYPE_DATETIME, 0, MY_I_S_MAYBE_NULL, NULL, SKIP_OPEN_TABLE },
{"status", 1024, MYSQL_TYPE_STRING, 0, MY_I_S_MAYBE_NULL, NULL, SKIP_OPEN_TABLE },
{NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE}
Column("id", SLonglong(0), NOT_NULL),
Column("database_name", Varchar(256), NOT_NULL),
Column("table_name", Varchar(256), NOT_NULL),
Column("job_type", Varchar(256), NOT_NULL),
Column("job_params", Varchar(256), NOT_NULL),
Column("scheduler", Varchar(32), NOT_NULL),
Column("scheduled_time", Datetime(0), NOT_NULL),
Column("started_time", Datetime(0), NULLABLE),
Column("status", Varchar(1024), NULLABLE),
CEnd()
};
struct background_job_status_extra {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment