Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
5e474f92
Commit
5e474f92
authored
Jun 22, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-19836 Reuse new I_S table definition helper classes for RocksDB
parent
8d098333
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
281 additions
and
125 deletions
+281
-125
storage/rocksdb/mysql-test/rocksdb/r/i_s.result
storage/rocksdb/mysql-test/rocksdb/r/i_s.result
+155
-0
storage/rocksdb/mysql-test/rocksdb/r/i_s_deadlock.result
storage/rocksdb/mysql-test/rocksdb/r/i_s_deadlock.result
+4
-4
storage/rocksdb/mysql-test/rocksdb/t/i_s.test
storage/rocksdb/mysql-test/rocksdb/t/i_s.test
+21
-0
storage/rocksdb/rdb_i_s.cc
storage/rocksdb/rdb_i_s.cc
+101
-121
No files found.
storage/rocksdb/mysql-test/rocksdb/r/i_s.result
0 → 100644
View file @
5e474f92
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='INFORMATION_SCHEMA'
AND TABLE_NAME LIKE 'ROCKSDB%'
ORDER BY TABLE_NAME;
TABLE_NAME
ROCKSDB_CFSTATS
ROCKSDB_CF_OPTIONS
ROCKSDB_COMPACTION_STATS
ROCKSDB_DBSTATS
ROCKSDB_DDL
ROCKSDB_DEADLOCK
ROCKSDB_GLOBAL_INFO
ROCKSDB_INDEX_FILE_MAP
ROCKSDB_LOCKS
ROCKSDB_PERF_CONTEXT
ROCKSDB_PERF_CONTEXT_GLOBAL
ROCKSDB_SST_PROPS
ROCKSDB_TRX
SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_CF_OPTIONS;
Table Create Table
ROCKSDB_CF_OPTIONS CREATE TEMPORARY TABLE `ROCKSDB_CF_OPTIONS` (
`CF_NAME` varchar(193) NOT NULL DEFAULT '',
`OPTION_TYPE` varchar(193) NOT NULL DEFAULT '',
`VALUE` varchar(193) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_CFSTATS;
Table Create Table
ROCKSDB_CFSTATS CREATE TEMPORARY TABLE `ROCKSDB_CFSTATS` (
`CF_NAME` varchar(193) NOT NULL DEFAULT '',
`STAT_TYPE` varchar(193) NOT NULL DEFAULT '',
`VALUE` bigint(21) NOT NULL DEFAULT 0
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_COMPACTION_STATS;
Table Create Table
ROCKSDB_COMPACTION_STATS CREATE TEMPORARY TABLE `ROCKSDB_COMPACTION_STATS` (
`CF_NAME` varchar(193) NOT NULL DEFAULT '',
`LEVEL` varchar(513) NOT NULL DEFAULT '',
`TYPE` varchar(513) NOT NULL DEFAULT '',
`VALUE` double NOT NULL DEFAULT 0
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_DBSTATS;
Table Create Table
ROCKSDB_DBSTATS CREATE TEMPORARY TABLE `ROCKSDB_DBSTATS` (
`STAT_TYPE` varchar(193) NOT NULL DEFAULT '',
`VALUE` bigint(21) NOT NULL DEFAULT 0
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_DDL;
Table Create Table
ROCKSDB_DDL CREATE TEMPORARY TABLE `ROCKSDB_DDL` (
`TABLE_SCHEMA` varchar(193) NOT NULL DEFAULT '',
`TABLE_NAME` varchar(193) NOT NULL DEFAULT '',
`PARTITION_NAME` varchar(193) DEFAULT NULL,
`INDEX_NAME` varchar(193) NOT NULL DEFAULT '',
`COLUMN_FAMILY` int(11) NOT NULL DEFAULT 0,
`INDEX_NUMBER` int(11) NOT NULL DEFAULT 0,
`INDEX_TYPE` smallint(6) NOT NULL DEFAULT 0,
`KV_FORMAT_VERSION` smallint(6) NOT NULL DEFAULT 0,
`TTL_DURATION` bigint(21) NOT NULL DEFAULT 0,
`INDEX_FLAGS` bigint(21) NOT NULL DEFAULT 0,
`CF` varchar(193) NOT NULL DEFAULT '',
`AUTO_INCREMENT` bigint(21) unsigned DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_DEADLOCK;
Table Create Table
ROCKSDB_DEADLOCK CREATE TEMPORARY TABLE `ROCKSDB_DEADLOCK` (
`DEADLOCK_ID` bigint(21) NOT NULL DEFAULT 0,
`TIMESTAMP` bigint(21) NOT NULL DEFAULT 0,
`TRANSACTION_ID` bigint(21) NOT NULL DEFAULT 0,
`CF_NAME` varchar(193) NOT NULL DEFAULT '',
`WAITING_KEY` varchar(513) NOT NULL DEFAULT '',
`LOCK_TYPE` varchar(193) NOT NULL DEFAULT '',
`INDEX_NAME` varchar(193) NOT NULL DEFAULT '',
`TABLE_NAME` varchar(193) NOT NULL DEFAULT '',
`ROLLED_BACK` bigint(21) NOT NULL DEFAULT 0
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO;
Table Create Table
ROCKSDB_GLOBAL_INFO CREATE TEMPORARY TABLE `ROCKSDB_GLOBAL_INFO` (
`TYPE` varchar(513) NOT NULL DEFAULT '',
`NAME` varchar(513) NOT NULL DEFAULT '',
`VALUE` varchar(513) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_INDEX_FILE_MAP;
Table Create Table
ROCKSDB_INDEX_FILE_MAP CREATE TEMPORARY TABLE `ROCKSDB_INDEX_FILE_MAP` (
`COLUMN_FAMILY` int(11) NOT NULL DEFAULT 0,
`INDEX_NUMBER` int(11) NOT NULL DEFAULT 0,
`SST_NAME` varchar(193) NOT NULL DEFAULT '',
`NUM_ROWS` bigint(21) NOT NULL DEFAULT 0,
`DATA_SIZE` bigint(21) NOT NULL DEFAULT 0,
`ENTRY_DELETES` bigint(21) NOT NULL DEFAULT 0,
`ENTRY_SINGLEDELETES` bigint(21) NOT NULL DEFAULT 0,
`ENTRY_MERGES` bigint(21) NOT NULL DEFAULT 0,
`ENTRY_OTHERS` bigint(21) NOT NULL DEFAULT 0,
`DISTINCT_KEYS_PREFIX` varchar(800) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_LOCKS;
Table Create Table
ROCKSDB_LOCKS CREATE TEMPORARY TABLE `ROCKSDB_LOCKS` (
`COLUMN_FAMILY_ID` int(11) NOT NULL DEFAULT 0,
`TRANSACTION_ID` int(11) NOT NULL DEFAULT 0,
`KEY` varchar(513) NOT NULL DEFAULT '',
`MODE` varchar(32) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_PERF_CONTEXT;
Table Create Table
ROCKSDB_PERF_CONTEXT CREATE TEMPORARY TABLE `ROCKSDB_PERF_CONTEXT` (
`TABLE_SCHEMA` varchar(193) NOT NULL DEFAULT '',
`TABLE_NAME` varchar(193) NOT NULL DEFAULT '',
`PARTITION_NAME` varchar(193) DEFAULT NULL,
`STAT_TYPE` varchar(193) NOT NULL DEFAULT '',
`VALUE` bigint(21) NOT NULL DEFAULT 0
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_PERF_CONTEXT_GLOBAL;
Table Create Table
ROCKSDB_PERF_CONTEXT_GLOBAL CREATE TEMPORARY TABLE `ROCKSDB_PERF_CONTEXT_GLOBAL` (
`STAT_TYPE` varchar(193) NOT NULL DEFAULT '',
`VALUE` bigint(21) NOT NULL DEFAULT 0
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_SST_PROPS;
Table Create Table
ROCKSDB_SST_PROPS CREATE TEMPORARY TABLE `ROCKSDB_SST_PROPS` (
`SST_NAME` varchar(193) NOT NULL DEFAULT '',
`COLUMN_FAMILY` int(11) NOT NULL DEFAULT 0,
`DATA_BLOCKS` bigint(21) NOT NULL DEFAULT 0,
`ENTRIES` bigint(21) NOT NULL DEFAULT 0,
`RAW_KEY_SIZE` bigint(21) NOT NULL DEFAULT 0,
`RAW_VALUE_SIZE` bigint(21) NOT NULL DEFAULT 0,
`DATA_BLOCK_SIZE` bigint(21) NOT NULL DEFAULT 0,
`INDEX_BLOCK_SIZE` bigint(21) NOT NULL DEFAULT 0,
`INDEX_PARTITIONS` int(11) NOT NULL DEFAULT 0,
`TOP_LEVEL_INDEX_SIZE` bigint(21) NOT NULL DEFAULT 0,
`FILTER_BLOCK_SIZE` bigint(21) NOT NULL DEFAULT 0,
`COMPRESSION_ALGO` varchar(193) NOT NULL DEFAULT '',
`CREATION_TIME` bigint(21) NOT NULL DEFAULT 0
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_TRX;
Table Create Table
ROCKSDB_TRX CREATE TEMPORARY TABLE `ROCKSDB_TRX` (
`TRANSACTION_ID` bigint(21) NOT NULL DEFAULT 0,
`STATE` varchar(193) NOT NULL DEFAULT '',
`NAME` varchar(193) NOT NULL DEFAULT '',
`WRITE_COUNT` bigint(21) NOT NULL DEFAULT 0,
`LOCK_COUNT` bigint(21) NOT NULL DEFAULT 0,
`TIMEOUT_SEC` int(11) NOT NULL DEFAULT 0,
`WAITING_KEY` varchar(513) NOT NULL DEFAULT '',
`WAITING_COLUMN_FAMILY_ID` int(11) NOT NULL DEFAULT 0,
`IS_REPLICATION` int(11) NOT NULL DEFAULT 0,
`SKIP_TRX_API` int(11) NOT NULL DEFAULT 0,
`READ_ONLY` int(11) NOT NULL DEFAULT 0,
`HAS_DEADLOCK_DETECTION` int(11) NOT NULL DEFAULT 0,
`NUM_ONGOING_BULKLOAD` int(11) NOT NULL DEFAULT 0,
`THREAD_ID` int(11) NOT NULL DEFAULT 0,
`QUERY` varchar(193) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
storage/rocksdb/mysql-test/rocksdb/r/i_s_deadlock.result
View file @
5e474f92
...
...
@@ -13,15 +13,15 @@ connection default;
show create table information_schema.rocksdb_deadlock;
Table Create Table
ROCKSDB_DEADLOCK CREATE TEMPORARY TABLE `ROCKSDB_DEADLOCK` (
`DEADLOCK_ID` bigint(
8
) NOT NULL DEFAULT 0,
`TIMESTAMP` bigint(
8
) NOT NULL DEFAULT 0,
`TRANSACTION_ID` bigint(
8
) NOT NULL DEFAULT 0,
`DEADLOCK_ID` bigint(
21
) NOT NULL DEFAULT 0,
`TIMESTAMP` bigint(
21
) NOT NULL DEFAULT 0,
`TRANSACTION_ID` bigint(
21
) NOT NULL DEFAULT 0,
`CF_NAME` varchar(193) NOT NULL DEFAULT '',
`WAITING_KEY` varchar(513) NOT NULL DEFAULT '',
`LOCK_TYPE` varchar(193) NOT NULL DEFAULT '',
`INDEX_NAME` varchar(193) NOT NULL DEFAULT '',
`TABLE_NAME` varchar(193) NOT NULL DEFAULT '',
`ROLLED_BACK` bigint(
8
) NOT NULL DEFAULT 0
`ROLLED_BACK` bigint(
21
) NOT NULL DEFAULT 0
) ENGINE=MEMORY DEFAULT CHARSET=utf8
create table t (i int primary key) engine=rocksdb;
insert into t values (1), (2), (3);
...
...
storage/rocksdb/mysql-test/rocksdb/t/i_s.test
0 → 100644
View file @
5e474f92
--
source
include
/
have_rocksdb
.
inc
--
source
include
/
have_partition
.
inc
SELECT
TABLE_NAME
FROM
INFORMATION_SCHEMA
.
TABLES
WHERE
TABLE_SCHEMA
=
'INFORMATION_SCHEMA'
AND
TABLE_NAME
LIKE
'ROCKSDB%'
ORDER
BY
TABLE_NAME
;
SHOW
CREATE
TABLE
INFORMATION_SCHEMA
.
ROCKSDB_CF_OPTIONS
;
SHOW
CREATE
TABLE
INFORMATION_SCHEMA
.
ROCKSDB_CFSTATS
;
SHOW
CREATE
TABLE
INFORMATION_SCHEMA
.
ROCKSDB_COMPACTION_STATS
;
SHOW
CREATE
TABLE
INFORMATION_SCHEMA
.
ROCKSDB_DBSTATS
;
SHOW
CREATE
TABLE
INFORMATION_SCHEMA
.
ROCKSDB_DDL
;
SHOW
CREATE
TABLE
INFORMATION_SCHEMA
.
ROCKSDB_DEADLOCK
;
SHOW
CREATE
TABLE
INFORMATION_SCHEMA
.
ROCKSDB_GLOBAL_INFO
;
SHOW
CREATE
TABLE
INFORMATION_SCHEMA
.
ROCKSDB_INDEX_FILE_MAP
;
SHOW
CREATE
TABLE
INFORMATION_SCHEMA
.
ROCKSDB_LOCKS
;
SHOW
CREATE
TABLE
INFORMATION_SCHEMA
.
ROCKSDB_PERF_CONTEXT
;
SHOW
CREATE
TABLE
INFORMATION_SCHEMA
.
ROCKSDB_PERF_CONTEXT_GLOBAL
;
SHOW
CREATE
TABLE
INFORMATION_SCHEMA
.
ROCKSDB_SST_PROPS
;
SHOW
CREATE
TABLE
INFORMATION_SCHEMA
.
ROCKSDB_TRX
;
storage/rocksdb/rdb_i_s.cc
View file @
5e474f92
...
...
@@ -65,11 +65,14 @@ namespace RDB_CFSTATS_FIELD {
enum
{
CF_NAME
=
0
,
STAT_TYPE
,
VALUE
};
}
// namespace RDB_CFSTATS_FIELD
using
namespace
Show
;
static
ST_FIELD_INFO
rdb_i_s_cfstats_fields_info
[]
=
{
ROCKSDB_FIELD_INFO
(
"CF_NAME"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"STAT_TYPE"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"VALUE"
,
sizeof
(
uint64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO_END
};
Column
(
"CF_NAME"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"STAT_TYPE"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"VALUE"
,
SLonglong
(),
NOT_NULL
),
CEnd
()
};
static
int
rdb_i_s_cfstats_fill_table
(
my_core
::
THD
*
const
thd
,
my_core
::
TABLE_LIST
*
const
tables
,
...
...
@@ -165,9 +168,9 @@ enum { STAT_TYPE = 0, VALUE };
}
// namespace RDB_DBSTATS_FIELD
static
ST_FIELD_INFO
rdb_i_s_dbstats_fields_info
[]
=
{
ROCKSDB_FIELD_INFO
(
"STAT_TYPE"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"VALUE"
,
sizeof
(
uint64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO_END
};
Column
(
"STAT_TYPE"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"VALUE"
,
SLonglong
(),
NOT_NULL
),
CEnd
()
};
static
int
rdb_i_s_dbstats_fill_table
(
my_core
::
THD
*
const
thd
,
my_core
::
TABLE_LIST
*
const
tables
,
...
...
@@ -261,13 +264,12 @@ enum { TABLE_SCHEMA = 0, TABLE_NAME, PARTITION_NAME, STAT_TYPE, VALUE };
}
// namespace RDB_PERF_CONTEXT_FIELD
static
ST_FIELD_INFO
rdb_i_s_perf_context_fields_info
[]
=
{
ROCKSDB_FIELD_INFO
(
"TABLE_SCHEMA"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"TABLE_NAME"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"PARTITION_NAME"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
MY_I_S_MAYBE_NULL
),
ROCKSDB_FIELD_INFO
(
"STAT_TYPE"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"VALUE"
,
sizeof
(
uint64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO_END
};
Column
(
"TABLE_SCHEMA"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"TABLE_NAME"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"PARTITION_NAME"
,
Varchar
(
NAME_LEN
+
1
),
NULLABLE
),
Column
(
"STAT_TYPE"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"VALUE"
,
SLonglong
(),
NOT_NULL
),
CEnd
()};
static
int
rdb_i_s_perf_context_fill_table
(
my_core
::
THD
*
const
thd
,
my_core
::
TABLE_LIST
*
const
tables
,
...
...
@@ -364,9 +366,9 @@ enum { STAT_TYPE = 0, VALUE };
}
// namespace RDB_PERF_CONTEXT_GLOBAL_FIELD
static
ST_FIELD_INFO
rdb_i_s_perf_context_global_fields_info
[]
=
{
ROCKSDB_FIELD_INFO
(
"STAT_TYPE"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"VALUE"
,
sizeof
(
uint64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO_END
};
Column
(
"STAT_TYPE"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"VALUE"
,
SLonglong
(),
NOT_NULL
),
CEnd
()
};
static
int
rdb_i_s_perf_context_global_fill_table
(
my_core
::
THD
*
const
thd
,
my_core
::
TABLE_LIST
*
const
tables
,
...
...
@@ -434,10 +436,10 @@ enum { CF_NAME = 0, OPTION_TYPE, VALUE };
}
// namespace RDB_CFOPTIONS_FIELD
static
ST_FIELD_INFO
rdb_i_s_cfoptions_fields_info
[]
=
{
ROCKSDB_FIELD_INFO
(
"CF_NAME"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"OPTION_TYPE"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"VALUE"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO_END
};
Column
(
"CF_NAME"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"OPTION_TYPE"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"VALUE"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
CEnd
()
};
static
int
rdb_i_s_cfoptions_fill_table
(
my_core
::
THD
*
const
thd
,
my_core
::
TABLE_LIST
*
const
tables
,
...
...
@@ -696,10 +698,10 @@ enum { TYPE = 0, NAME, VALUE };
}
static
ST_FIELD_INFO
rdb_i_s_global_info_fields_info
[]
=
{
ROCKSDB_FIELD_INFO
(
"TYPE"
,
FN_REFLEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"NAME"
,
FN_REFLEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"VALUE"
,
FN_REFLEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO_END
};
Column
(
"TYPE"
,
Varchar
(
FN_REFLEN
+
1
),
NOT_NULL
),
Column
(
"NAME"
,
Varchar
(
FN_REFLEN
+
1
),
NOT_NULL
),
Column
(
"VALUE"
,
Varchar
(
FN_REFLEN
+
1
),
NOT_NULL
),
CEnd
()
};
/*
* helper function for rdb_i_s_global_info_fill_table
...
...
@@ -899,11 +901,11 @@ static int rdb_i_s_compact_stats_fill_table(
}
static
ST_FIELD_INFO
rdb_i_s_compact_stats_fields_info
[]
=
{
ROCKSDB_FIELD_INFO
(
"CF_NAME"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"LEVEL"
,
FN_REFLEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"TYPE"
,
FN_REFLEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"VALUE"
,
sizeof
(
double
),
MYSQL_TYPE_DOUBLE
,
0
),
ROCKSDB_FIELD_INFO_END
};
Column
(
"CF_NAME"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"LEVEL"
,
Varchar
(
FN_REFLEN
+
1
),
NOT_NULL
),
Column
(
"TYPE"
,
Varchar
(
FN_REFLEN
+
1
),
NOT_NULL
),
Column
(
"VALUE"
,
Double
(
MY_INT64_NUM_DECIMAL_DIGITS
),
NOT_NULL
),
CEnd
()
};
namespace
// anonymous namespace = not visible outside this source file
{
...
...
@@ -936,22 +938,19 @@ enum {
}
// namespace RDB_DDL_FIELD
static
ST_FIELD_INFO
rdb_i_s_ddl_fields_info
[]
=
{
ROCKSDB_FIELD_INFO
(
"TABLE_SCHEMA"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"TABLE_NAME"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"PARTITION_NAME"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
MY_I_S_MAYBE_NULL
),
ROCKSDB_FIELD_INFO
(
"INDEX_NAME"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"COLUMN_FAMILY"
,
sizeof
(
uint32_t
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"INDEX_NUMBER"
,
sizeof
(
uint32_t
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"INDEX_TYPE"
,
sizeof
(
uint16_t
),
MYSQL_TYPE_SHORT
,
0
),
ROCKSDB_FIELD_INFO
(
"KV_FORMAT_VERSION"
,
sizeof
(
uint16_t
),
MYSQL_TYPE_SHORT
,
0
),
ROCKSDB_FIELD_INFO
(
"TTL_DURATION"
,
sizeof
(
uint64
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"INDEX_FLAGS"
,
sizeof
(
uint64
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"CF"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"AUTO_INCREMENT"
,
sizeof
(
uint64_t
),
MYSQL_TYPE_LONGLONG
,
MY_I_S_MAYBE_NULL
|
MY_I_S_UNSIGNED
),
ROCKSDB_FIELD_INFO_END
};
Column
(
"TABLE_SCHEMA"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"TABLE_NAME"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"PARTITION_NAME"
,
Varchar
(
NAME_LEN
+
1
),
NULLABLE
),
Column
(
"INDEX_NAME"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"COLUMN_FAMILY"
,
SLong
(),
NOT_NULL
),
Column
(
"INDEX_NUMBER"
,
SLong
(),
NOT_NULL
),
Column
(
"INDEX_TYPE"
,
SShort
(
6
),
NOT_NULL
),
Column
(
"KV_FORMAT_VERSION"
,
SShort
(
6
),
NOT_NULL
),
Column
(
"TTL_DURATION"
,
SLonglong
(),
NOT_NULL
),
Column
(
"INDEX_FLAGS"
,
SLonglong
(),
NOT_NULL
),
Column
(
"CF"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"AUTO_INCREMENT"
,
ULonglong
(),
NULLABLE
),
CEnd
()};
int
Rdb_ddl_scanner
::
add_table
(
Rdb_tbl_def
*
tdef
)
{
DBUG_ASSERT
(
tdef
!=
nullptr
);
...
...
@@ -1151,27 +1150,20 @@ enum {
}
// namespace RDB_SST_PROPS_FIELD
static
ST_FIELD_INFO
rdb_i_s_sst_props_fields_info
[]
=
{
ROCKSDB_FIELD_INFO
(
"SST_NAME"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"COLUMN_FAMILY"
,
sizeof
(
uint32_t
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"DATA_BLOCKS"
,
sizeof
(
int64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"ENTRIES"
,
sizeof
(
int64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"RAW_KEY_SIZE"
,
sizeof
(
int64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"RAW_VALUE_SIZE"
,
sizeof
(
int64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"DATA_BLOCK_SIZE"
,
sizeof
(
int64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"INDEX_BLOCK_SIZE"
,
sizeof
(
int64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"INDEX_PARTITIONS"
,
sizeof
(
uint32_t
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"TOP_LEVEL_INDEX_SIZE"
,
sizeof
(
int64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"FILTER_BLOCK_SIZE"
,
sizeof
(
int64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"COMPRESSION_ALGO"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"CREATION_TIME"
,
sizeof
(
int64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO_END
};
Column
(
"SST_NAME"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"COLUMN_FAMILY"
,
SLong
(),
NOT_NULL
),
Column
(
"DATA_BLOCKS"
,
SLonglong
(),
NOT_NULL
),
Column
(
"ENTRIES"
,
SLonglong
(),
NOT_NULL
),
Column
(
"RAW_KEY_SIZE"
,
SLonglong
(),
NOT_NULL
),
Column
(
"RAW_VALUE_SIZE"
,
SLonglong
(),
NOT_NULL
),
Column
(
"DATA_BLOCK_SIZE"
,
SLonglong
(),
NOT_NULL
),
Column
(
"INDEX_BLOCK_SIZE"
,
SLonglong
(),
NOT_NULL
),
Column
(
"INDEX_PARTITIONS"
,
SLong
(),
NOT_NULL
),
Column
(
"TOP_LEVEL_INDEX_SIZE"
,
SLonglong
(),
NOT_NULL
),
Column
(
"FILTER_BLOCK_SIZE"
,
SLonglong
(),
NOT_NULL
),
Column
(
"COMPRESSION_ALGO"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"CREATION_TIME"
,
SLonglong
(),
NOT_NULL
),
CEnd
()};
static
int
rdb_i_s_sst_props_fill_table
(
my_core
::
THD
*
const
thd
,
my_core
::
TABLE_LIST
*
const
tables
,
...
...
@@ -1299,20 +1291,17 @@ static ST_FIELD_INFO rdb_i_s_index_file_map_fields_info[] = {
* SST_NAME => the name of the SST file containing some indexes
* NUM_ROWS => the number of entries of this index id in this SST file
* DATA_SIZE => the data size stored in this SST file for this index id */
ROCKSDB_FIELD_INFO
(
"COLUMN_FAMILY"
,
sizeof
(
uint32_t
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"INDEX_NUMBER"
,
sizeof
(
uint32_t
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"SST_NAME"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"NUM_ROWS"
,
sizeof
(
int64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"DATA_SIZE"
,
sizeof
(
int64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"ENTRY_DELETES"
,
sizeof
(
int64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"ENTRY_SINGLEDELETES"
,
sizeof
(
int64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"ENTRY_MERGES"
,
sizeof
(
int64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"ENTRY_OTHERS"
,
sizeof
(
int64_t
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"DISTINCT_KEYS_PREFIX"
,
MAX_REF_PARTS
*
25
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO_END
};
Column
(
"COLUMN_FAMILY"
,
SLong
(),
NOT_NULL
),
Column
(
"INDEX_NUMBER"
,
SLong
(),
NOT_NULL
),
Column
(
"SST_NAME"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"NUM_ROWS"
,
SLonglong
(),
NOT_NULL
),
Column
(
"DATA_SIZE"
,
SLonglong
(),
NOT_NULL
),
Column
(
"ENTRY_DELETES"
,
SLonglong
(),
NOT_NULL
),
Column
(
"ENTRY_SINGLEDELETES"
,
SLonglong
(),
NOT_NULL
),
Column
(
"ENTRY_MERGES"
,
SLonglong
(),
NOT_NULL
),
Column
(
"ENTRY_OTHERS"
,
SLonglong
(),
NOT_NULL
),
Column
(
"DISTINCT_KEYS_PREFIX"
,
Varchar
(
MAX_REF_PARTS
*
25
),
NOT_NULL
),
CEnd
()};
/* Fill the information_schema.rocksdb_index_file_map virtual table */
static
int
rdb_i_s_index_file_map_fill_table
(
...
...
@@ -1446,12 +1435,11 @@ enum { COLUMN_FAMILY_ID = 0, TRANSACTION_ID, KEY, MODE };
}
// namespace RDB_LOCKS_FIELD
static
ST_FIELD_INFO
rdb_i_s_lock_info_fields_info
[]
=
{
ROCKSDB_FIELD_INFO
(
"COLUMN_FAMILY_ID"
,
sizeof
(
uint32_t
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"TRANSACTION_ID"
,
sizeof
(
uint32_t
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"KEY"
,
FN_REFLEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"MODE"
,
32
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO_END
};
Column
(
"COLUMN_FAMILY_ID"
,
SLong
(),
NOT_NULL
),
Column
(
"TRANSACTION_ID"
,
SLong
(),
NOT_NULL
),
Column
(
"KEY"
,
Varchar
(
FN_REFLEN
+
1
),
NOT_NULL
),
Column
(
"MODE"
,
Varchar
(
32
),
NOT_NULL
),
CEnd
()};
/* Fill the information_schema.rocksdb_locks virtual table */
static
int
rdb_i_s_lock_info_fill_table
(
...
...
@@ -1548,27 +1536,22 @@ enum {
}
// namespace RDB_TRX_FIELD
static
ST_FIELD_INFO
rdb_i_s_trx_info_fields_info
[]
=
{
ROCKSDB_FIELD_INFO
(
"TRANSACTION_ID"
,
sizeof
(
ulonglong
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"STATE"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"NAME"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"WRITE_COUNT"
,
sizeof
(
ulonglong
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"LOCK_COUNT"
,
sizeof
(
ulonglong
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"TIMEOUT_SEC"
,
sizeof
(
uint32_t
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"WAITING_KEY"
,
FN_REFLEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"WAITING_COLUMN_FAMILY_ID"
,
sizeof
(
uint32_t
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"IS_REPLICATION"
,
sizeof
(
uint32_t
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"SKIP_TRX_API"
,
sizeof
(
uint32_t
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"READ_ONLY"
,
sizeof
(
uint32_t
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"HAS_DEADLOCK_DETECTION"
,
sizeof
(
uint32_t
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"NUM_ONGOING_BULKLOAD"
,
sizeof
(
uint32_t
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"THREAD_ID"
,
sizeof
(
ulong
),
MYSQL_TYPE_LONG
,
0
),
ROCKSDB_FIELD_INFO
(
"QUERY"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO_END
};
Column
(
"TRANSACTION_ID"
,
SLonglong
(),
NOT_NULL
),
Column
(
"STATE"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"NAME"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"WRITE_COUNT"
,
SLonglong
(),
NOT_NULL
),
Column
(
"LOCK_COUNT"
,
SLonglong
(),
NOT_NULL
),
Column
(
"TIMEOUT_SEC"
,
SLong
(),
NOT_NULL
),
Column
(
"WAITING_KEY"
,
Varchar
(
FN_REFLEN
+
1
),
NOT_NULL
),
Column
(
"WAITING_COLUMN_FAMILY_ID"
,
SLong
(),
NOT_NULL
),
Column
(
"IS_REPLICATION"
,
SLong
(),
NOT_NULL
),
Column
(
"SKIP_TRX_API"
,
SLong
(),
NOT_NULL
),
Column
(
"READ_ONLY"
,
SLong
(),
NOT_NULL
),
Column
(
"HAS_DEADLOCK_DETECTION"
,
SLong
(),
NOT_NULL
),
Column
(
"NUM_ONGOING_BULKLOAD"
,
SLong
(),
NOT_NULL
),
Column
(
"THREAD_ID"
,
SLong
(),
NOT_NULL
),
Column
(
"QUERY"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
CEnd
()};
/* Fill the information_schema.rocksdb_trx virtual table */
static
int
rdb_i_s_trx_info_fill_table
(
...
...
@@ -1675,19 +1658,16 @@ enum {
}
// namespace RDB_TRX_FIELD
static
ST_FIELD_INFO
rdb_i_s_deadlock_info_fields_info
[]
=
{
ROCKSDB_FIELD_INFO
(
"DEADLOCK_ID"
,
sizeof
(
ulonglong
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"TIMESTAMP"
,
sizeof
(
ulonglong
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"TRANSACTION_ID"
,
sizeof
(
ulonglong
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO
(
"CF_NAME"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"WAITING_KEY"
,
FN_REFLEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"LOCK_TYPE"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"INDEX_NAME"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"TABLE_NAME"
,
NAME_LEN
+
1
,
MYSQL_TYPE_STRING
,
0
),
ROCKSDB_FIELD_INFO
(
"ROLLED_BACK"
,
sizeof
(
ulonglong
),
MYSQL_TYPE_LONGLONG
,
0
),
ROCKSDB_FIELD_INFO_END
};
Column
(
"DEADLOCK_ID"
,
SLonglong
(),
NOT_NULL
),
Column
(
"TIMESTAMP"
,
SLonglong
(),
NOT_NULL
),
Column
(
"TRANSACTION_ID"
,
SLonglong
(),
NOT_NULL
),
Column
(
"CF_NAME"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"WAITING_KEY"
,
Varchar
(
FN_REFLEN
+
1
),
NOT_NULL
),
Column
(
"LOCK_TYPE"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"INDEX_NAME"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"TABLE_NAME"
,
Varchar
(
NAME_LEN
+
1
),
NOT_NULL
),
Column
(
"ROLLED_BACK"
,
SLonglong
(),
NOT_NULL
),
CEnd
()};
/* Fill the information_schema.rocksdb_trx virtual table */
static
int
rdb_i_s_deadlock_info_fill_table
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment