Commit c7eead7a authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-3807 show plugins soname 'xxx'

and INFORMATION_SCHEMA.ALL_PLUGINS table
with condition pushdown for I_S.ALL_PLUGINS
and a  new status variable to cound successful dlopen's
parent 5f293dd6
......@@ -36,6 +36,7 @@ KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
PARAMETERS SPECIFIC_SCHEMA
PARTITIONS TABLE_SCHEMA
PLUGINS PLUGIN_NAME
ALL_PLUGINS PLUGIN_NAME
PROCESSLIST ID
PROFILING QUERY_ID
REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
......@@ -88,6 +89,7 @@ KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
PARAMETERS SPECIFIC_SCHEMA
PARTITIONS TABLE_SCHEMA
PLUGINS PLUGIN_NAME
ALL_PLUGINS PLUGIN_NAME
PROCESSLIST ID
PROFILING QUERY_ID
REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
......
......@@ -46,6 +46,7 @@ table_name not like 'ndb_%' AND table_name not like 'innodb_%' AND
table_name not like 'pbxt_%' AND table_name not like 'xtradb_%';
select * from v1;
c
ALL_PLUGINS
CHARACTER_SETS
CLIENT_STATISTICS
COLLATIONS
......@@ -802,6 +803,7 @@ information_schema PARTITIONS PARTITION_EXPRESSION
information_schema PARTITIONS SUBPARTITION_EXPRESSION
information_schema PARTITIONS PARTITION_DESCRIPTION
information_schema PLUGINS PLUGIN_DESCRIPTION
information_schema ALL_PLUGINS PLUGIN_DESCRIPTION
information_schema PROCESSLIST INFO
information_schema ROUTINES DTD_IDENTIFIER
information_schema ROUTINES ROUTINE_DEFINITION
......@@ -1180,7 +1182,7 @@ group by column_type order by num;
column_type group_concat(table_schema, '.', table_name) num
varchar(27) information_schema.COLUMNS 1
varchar(7) information_schema.ROUTINES,information_schema.VIEWS 2
varchar(20) information_schema.FILES,information_schema.FILES,information_schema.PLUGINS,information_schema.PLUGINS,information_schema.PLUGINS,information_schema.PROFILING 6
varchar(20) information_schema.FILES,information_schema.FILES,information_schema.PLUGINS,information_schema.PLUGINS,information_schema.PLUGINS,information_schema.ALL_PLUGINS,information_schema.ALL_PLUGINS,information_schema.ALL_PLUGINS,information_schema.PROFILING 9
create table t1(f1 char(1) not null, f2 char(9) not null)
default character set utf8;
select CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH from
......
use INFORMATION_SCHEMA;
show tables;
Tables_in_information_schema
ALL_PLUGINS
CHARACTER_SETS
CLIENT_STATISTICS
COLLATIONS
......@@ -74,6 +75,7 @@ c2.table_name = t.table_name AND
c2.column_name LIKE '%SCHEMA%'
) order by t.table_name;
table_name column_name
ALL_PLUGINS PLUGIN_NAME
CHARACTER_SETS CHARACTER_SET_NAME
CLIENT_STATISTICS CLIENT
COLLATIONS COLLATION_NAME
......@@ -147,6 +149,7 @@ c2.table_name = t.table_name AND
c2.column_name LIKE '%SCHEMA%'
) order by t.table_name;
table_name column_name
ALL_PLUGINS PLUGIN_NAME
CHARACTER_SETS CHARACTER_SET_NAME
CLIENT_STATISTICS CLIENT
COLLATIONS COLLATION_NAME
......@@ -205,7 +208,7 @@ USER_PRIVILEGES GRANTEE
USER_STATISTICS USER
VIEWS TABLE_SCHEMA
XTRADB_ADMIN_COMMAND result_message
select 1 as f1 from information_schema.tables where "CHARACTER_SETS"=
select 1 as f1 from information_schema.tables where "ALL_PLUGINS"=
(select cast(table_name as char) from information_schema.tables
order by table_name limit 1) limit 1;
f1
......@@ -226,6 +229,7 @@ c2.table_schema='information_schema' and
group by c2.column_type order by num limit 1)
group by t.table_name order by num1, t.table_name;
table_name group_concat(t.table_schema, '.', t.table_name) num1
ALL_PLUGINS information_schema.ALL_PLUGINS 1
CHARACTER_SETS information_schema.CHARACTER_SETS 1
CLIENT_STATISTICS information_schema.CLIENT_STATISTICS 1
COLLATIONS information_schema.COLLATIONS 1
......@@ -288,6 +292,7 @@ VIEWS information_schema.VIEWS 1
+---------------------------------------+
Database: information_schema
| Tables |
| ALL_PLUGINS |
| CHARACTER_SETS |
| CLIENT_STATISTICS |
| COLLATIONS |
......@@ -351,6 +356,7 @@ Database: information_schema
+---------------------------------------+
Database: INFORMATION_SCHEMA
| Tables |
| ALL_PLUGINS |
| CHARACTER_SETS |
| CLIENT_STATISTICS |
| COLLATIONS |
......@@ -417,5 +423,5 @@ Wildcard: inf_rmation_schema
| information_schema |
SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
table_schema count(*)
information_schema 58
information_schema 59
mysql 26
......@@ -3,6 +3,19 @@ WHERE table_schema = 'information_schema'
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
def information_schema ALL_PLUGINS LOAD_OPTION 11 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema ALL_PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema ALL_PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80) select
def information_schema ALL_PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select
def information_schema ALL_PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema ALL_PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) select
def information_schema ALL_PLUGINS PLUGIN_LICENSE 10 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80) select
def information_schema ALL_PLUGINS PLUGIN_MATURITY 12 NO varchar 12 36 NULL NULL NULL utf8 utf8_general_ci varchar(12) select
def information_schema ALL_PLUGINS PLUGIN_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema ALL_PLUGINS PLUGIN_STATUS 3 NO varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) select
def information_schema ALL_PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80) select
def information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) select
def information_schema ALL_PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) select
def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
def information_schema CHARACTER_SETS DESCRIPTION 3 NO varchar 60 180 NULL NULL NULL utf8 utf8_general_ci varchar(60) select
......@@ -215,7 +228,7 @@ def information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 N
def information_schema PLUGINS PLUGIN_LICENSE 10 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80) select
def information_schema PLUGINS PLUGIN_MATURITY 12 NO varchar 12 36 NULL NULL NULL utf8 utf8_general_ci varchar(12) select
def information_schema PLUGINS PLUGIN_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema PLUGINS PLUGIN_STATUS 3 NO varchar 10 30 NULL NULL NULL utf8 utf8_general_ci varchar(10) select
def information_schema PLUGINS PLUGIN_STATUS 3 NO varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) select
def information_schema PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80) select
def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) select
def information_schema PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) select
......@@ -473,6 +486,19 @@ WHERE table_schema = 'information_schema'
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
3.0000 information_schema ALL_PLUGINS PLUGIN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema ALL_PLUGINS PLUGIN_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema ALL_PLUGINS PLUGIN_STATUS varchar 16 48 utf8 utf8_general_ci varchar(16)
3.0000 information_schema ALL_PLUGINS PLUGIN_TYPE varchar 80 240 utf8 utf8_general_ci varchar(80)
3.0000 information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema ALL_PLUGINS PLUGIN_LIBRARY varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema ALL_PLUGINS PLUGIN_LIBRARY_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema ALL_PLUGINS PLUGIN_AUTHOR varchar 64 192 utf8 utf8_general_ci varchar(64)
1.0000 information_schema ALL_PLUGINS PLUGIN_DESCRIPTION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema ALL_PLUGINS PLUGIN_LICENSE varchar 80 240 utf8 utf8_general_ci varchar(80)
3.0000 information_schema ALL_PLUGINS LOAD_OPTION varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema ALL_PLUGINS PLUGIN_MATURITY varchar 12 36 utf8 utf8_general_ci varchar(12)
3.0000 information_schema ALL_PLUGINS PLUGIN_AUTH_VERSION varchar 80 240 utf8 utf8_general_ci varchar(80)
3.0000 information_schema CHARACTER_SETS CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema CHARACTER_SETS DESCRIPTION varchar 60 180 utf8 utf8_general_ci varchar(60)
......@@ -678,7 +704,7 @@ NULL information_schema PARTITIONS CHECKSUM bigint NULL NULL NULL NULL bigint(21
3.0000 information_schema PARTITIONS TABLESPACE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema PLUGINS PLUGIN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema PLUGINS PLUGIN_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema PLUGINS PLUGIN_STATUS varchar 10 30 utf8 utf8_general_ci varchar(10)
3.0000 information_schema PLUGINS PLUGIN_STATUS varchar 16 48 utf8 utf8_general_ci varchar(16)
3.0000 information_schema PLUGINS PLUGIN_TYPE varchar 80 240 utf8 utf8_general_ci varchar(80)
3.0000 information_schema PLUGINS PLUGIN_TYPE_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema PLUGINS PLUGIN_LIBRARY varchar 64 192 utf8 utf8_general_ci varchar(64)
......
......@@ -4,6 +4,19 @@ AND table_name <> 'profiling' AND table_name not like 'innodb_%'
AND table_name not like 'pbxt_%'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
def information_schema ALL_PLUGINS LOAD_OPTION 11 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema ALL_PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema ALL_PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80)
def information_schema ALL_PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext
def information_schema ALL_PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema ALL_PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20)
def information_schema ALL_PLUGINS PLUGIN_LICENSE 10 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80)
def information_schema ALL_PLUGINS PLUGIN_MATURITY 12 NO varchar 12 36 NULL NULL NULL utf8 utf8_general_ci varchar(12)
def information_schema ALL_PLUGINS PLUGIN_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema ALL_PLUGINS PLUGIN_STATUS 3 NO varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16)
def information_schema ALL_PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80)
def information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20)
def information_schema ALL_PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20)
def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
def information_schema CHARACTER_SETS DESCRIPTION 3 NO varchar 60 180 NULL NULL NULL utf8 utf8_general_ci varchar(60)
......@@ -216,7 +229,7 @@ def information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 N
def information_schema PLUGINS PLUGIN_LICENSE 10 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80)
def information_schema PLUGINS PLUGIN_MATURITY 12 NO varchar 12 36 NULL NULL NULL utf8 utf8_general_ci varchar(12)
def information_schema PLUGINS PLUGIN_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema PLUGINS PLUGIN_STATUS 3 NO varchar 10 30 NULL NULL NULL utf8 utf8_general_ci varchar(10)
def information_schema PLUGINS PLUGIN_STATUS 3 NO varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16)
def information_schema PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80)
def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20)
def information_schema PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20)
......@@ -478,6 +491,19 @@ AND table_name <> 'profiling' AND table_name not like 'innodb_%'
AND table_name not like 'pbxt_%'
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
3.0000 information_schema ALL_PLUGINS PLUGIN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema ALL_PLUGINS PLUGIN_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema ALL_PLUGINS PLUGIN_STATUS varchar 16 48 utf8 utf8_general_ci varchar(16)
3.0000 information_schema ALL_PLUGINS PLUGIN_TYPE varchar 80 240 utf8 utf8_general_ci varchar(80)
3.0000 information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema ALL_PLUGINS PLUGIN_LIBRARY varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema ALL_PLUGINS PLUGIN_LIBRARY_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema ALL_PLUGINS PLUGIN_AUTHOR varchar 64 192 utf8 utf8_general_ci varchar(64)
1.0000 information_schema ALL_PLUGINS PLUGIN_DESCRIPTION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema ALL_PLUGINS PLUGIN_LICENSE varchar 80 240 utf8 utf8_general_ci varchar(80)
3.0000 information_schema ALL_PLUGINS LOAD_OPTION varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema ALL_PLUGINS PLUGIN_MATURITY varchar 12 36 utf8 utf8_general_ci varchar(12)
3.0000 information_schema ALL_PLUGINS PLUGIN_AUTH_VERSION varchar 80 240 utf8 utf8_general_ci varchar(80)
3.0000 information_schema CHARACTER_SETS CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema CHARACTER_SETS DESCRIPTION varchar 60 180 utf8 utf8_general_ci varchar(60)
......@@ -683,7 +709,7 @@ NULL information_schema PARTITIONS CHECKSUM bigint NULL NULL NULL NULL bigint(21
3.0000 information_schema PARTITIONS TABLESPACE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema PLUGINS PLUGIN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema PLUGINS PLUGIN_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema PLUGINS PLUGIN_STATUS varchar 10 30 utf8 utf8_general_ci varchar(10)
3.0000 information_schema PLUGINS PLUGIN_STATUS varchar 16 48 utf8 utf8_general_ci varchar(16)
3.0000 information_schema PLUGINS PLUGIN_TYPE varchar 80 240 utf8 utf8_general_ci varchar(80)
3.0000 information_schema PLUGINS PLUGIN_TYPE_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema PLUGINS PLUGIN_LIBRARY varchar 64 192 utf8 utf8_general_ci varchar(64)
......
......@@ -16,6 +16,29 @@ AND table_name not like 'pbxt_%' AND table_name not like 'xtradb_%'
ORDER BY table_schema,table_name;
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ALL_PLUGINS
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
VERSION 10
ROW_FORMAT DYNAMIC_OR_PAGE
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
INDEX_LENGTH #IL#
DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME CHARACTER_SETS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
......@@ -816,6 +839,29 @@ AND table_name not like 'pbxt_%' AND table_name not like 'xtradb_%'
ORDER BY table_schema,table_name;
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ALL_PLUGINS
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
VERSION 10
ROW_FORMAT DYNAMIC_OR_PAGE
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
INDEX_LENGTH #IL#
DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME CHARACTER_SETS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
......
......@@ -16,6 +16,29 @@ AND table_name not like 'pbxt_%' AND table_name not like 'xtradb_%'
ORDER BY table_schema,table_name;
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ALL_PLUGINS
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
VERSION 10
ROW_FORMAT DYNAMIC_OR_PAGE
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
INDEX_LENGTH #IL#
DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME CHARACTER_SETS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
......@@ -816,6 +839,29 @@ AND table_name not like 'pbxt_%' AND table_name not like 'xtradb_%'
ORDER BY table_schema,table_name;
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ALL_PLUGINS
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
VERSION 10
ROW_FORMAT DYNAMIC_OR_PAGE
TABLE_ROWS #TBLR#
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
INDEX_LENGTH #IL#
DATA_FREE #DF#
AUTO_INCREMENT NULL
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
TABLE_COLLATION utf8_general_ci
CHECKSUM NULL
CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME CHARACTER_SETS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
......
flush status;
show status like '%libraries%';
Variable_name Value
Opened_plugin_libraries 0
select * from information_schema.all_plugins where plugin_library='ha_example.so';
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_TYPE_VERSION PLUGIN_LIBRARY PLUGIN_LIBRARY_VERSION PLUGIN_AUTHOR PLUGIN_DESCRIPTION PLUGIN_LICENSE LOAD_OPTION PLUGIN_MATURITY PLUGIN_AUTH_VERSION
EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE 100001.0 ha_example.so 1.4 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1
UNUSABLE 3.14 NOT INSTALLED DAEMON 100001.0 ha_example.so 1.4 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926
show status like '%libraries%';
Variable_name Value
Opened_plugin_libraries 1
show plugins soname 'ha_example.so';
Name Status Type Library License
EXAMPLE NOT INSTALLED STORAGE ENGINE ha_example.so GPL
UNUSABLE NOT INSTALLED DAEMON ha_example.so GPL
show status like '%libraries%';
Variable_name Value
Opened_plugin_libraries 2
show plugins soname like '%example%';
Name Status Type Library License
EXAMPLE NOT INSTALLED STORAGE ENGINE ha_example.so GPL
UNUSABLE NOT INSTALLED DAEMON ha_example.so GPL
daemon_example NOT INSTALLED DAEMON libdaemon_example.so GPL
three_attempts NOT INSTALLED AUTHENTICATION dialog_examples.so GPL
two_questions NOT INSTALLED AUTHENTICATION dialog_examples.so GPL
show status like '%libraries%';
Variable_name Value
Opened_plugin_libraries 6
show plugins soname where library = 'ha_example.so';
Name Status Type Library License
EXAMPLE NOT INSTALLED STORAGE ENGINE ha_example.so GPL
UNUSABLE NOT INSTALLED DAEMON ha_example.so GPL
select variable_value > 10 from information_schema.global_status where variable_name like '%libraries%';
variable_value > 10
1
if (!$DIALOG_EXAMPLES_SO) { skip requires dialog_examples.so; }
if (!$HA_EXAMPLE_SO) { skip requires ha_examples.so; }
if (!$LIBDAEMON_EXAMPLE_SO) { skip requires libdaemon_examples.so; }
if (!$UDF_EXAMPLE_SO) { skip requires udf_example.so; }
flush status;
show status like '%libraries%';
#--sorted_result
#select * from information_schema.all_plugins;
#show status like '%libraries%';
select * from information_schema.all_plugins where plugin_library='ha_example.so';
show status like '%libraries%';
--sorted_result
show plugins soname 'ha_example.so';
show status like '%libraries%';
--sorted_result
show plugins soname like '%example%';
show status like '%libraries%';
--sorted_result
show plugins soname where library = 'ha_example.so';
select variable_value > 10 from information_schema.global_status where variable_name like '%libraries%';
......@@ -7,7 +7,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340 `VAROPT`='5'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
......
......@@ -49,7 +49,7 @@ SELECT t.table_name, c1.column_name
#
# Bug#24630 Subselect query crashes mysqld
#
select 1 as f1 from information_schema.tables where "CHARACTER_SETS"=
select 1 as f1 from information_schema.tables where "ALL_PLUGINS"=
(select cast(table_name as char) from information_schema.tables
order by table_name limit 1) limit 1;
......
......@@ -610,6 +610,7 @@ enum enum_schema_tables
SCH_PARAMETERS,
SCH_PARTITIONS,
SCH_PLUGINS,
SCH_ALL_PLUGINS,
SCH_PROCESSLIST,
SCH_PROFILES,
SCH_REFERENTIAL_CONSTRAINTS,
......
......@@ -7115,7 +7115,7 @@ SHOW_VAR status_vars[]= {
{"Handler_icp_match", (char*) offsetof(STATUS_VAR, ha_icp_match), SHOW_LONG_STATUS},
{"Handler_mrr_init", (char*) offsetof(STATUS_VAR, ha_mrr_init_count), SHOW_LONG_STATUS},
{"Handler_mrr_key_refills", (char*) offsetof(STATUS_VAR, ha_mrr_key_refills_count), SHOW_LONG_STATUS},
{"Handler_mrr_rowid_refills", (char*) offsetof(STATUS_VAR, ha_mrr_rowid_refills_count), SHOW_LONG_STATUS},
{"Handler_mrr_rowid_refills",(char*) offsetof(STATUS_VAR, ha_mrr_rowid_refills_count), SHOW_LONG_STATUS},
{"Handler_prepare", (char*) offsetof(STATUS_VAR, ha_prepare_count), SHOW_LONG_STATUS},
{"Handler_read_first", (char*) offsetof(STATUS_VAR, ha_read_first_count), SHOW_LONG_STATUS},
{"Handler_read_key", (char*) offsetof(STATUS_VAR, ha_read_key_count), SHOW_LONG_STATUS},
......@@ -7142,6 +7142,7 @@ SHOW_VAR status_vars[]= {
{"Open_table_definitions", (char*) &show_table_definitions, SHOW_SIMPLE_FUNC},
{"Open_tables", (char*) &show_open_tables, SHOW_SIMPLE_FUNC},
{"Opened_files", (char*) &my_file_total_opened, SHOW_LONG_NOFLUSH},
{"Opened_plugin_libraries", (char*) &dlopen_count, SHOW_LONG},
{"Opened_table_definitions", (char*) offsetof(STATUS_VAR, opened_shares), SHOW_LONG_STATUS},
{"Opened_tables", (char*) offsetof(STATUS_VAR, opened_tables), SHOW_LONG_STATUS},
{"Opened_views", (char*) offsetof(STATUS_VAR, opened_views), SHOW_LONG_STATUS},
......
......@@ -53,7 +53,6 @@ static TYPELIB global_plugin_typelib=
{ array_elements(global_plugin_typelib_names)-1,
"", global_plugin_typelib_names, NULL };
char *opt_plugin_load= NULL;
char *opt_plugin_dir_ptr;
char opt_plugin_dir[FN_REFLEN];
......@@ -197,6 +196,8 @@ static bool reap_needed= false;
static int plugin_array_version=0;
static bool initialized= 0;
ulong dlopen_count;
/*
write-lock on LOCK_system_variables_hash is required before modifying
......@@ -746,6 +747,7 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, errno, errmsg);
goto ret;
}
dlopen_count++;
/* Checks which plugin interface present and reads info */
if (!(sym= dlsym(plugin_dl.handle, maria_plugin_interface_version_sym)))
......@@ -1485,6 +1487,8 @@ int plugin_init(int *argc, char **argv, int flags)
if (initialized)
DBUG_RETURN(0);
dlopen_count =0;
#ifdef HAVE_PSI_INTERFACE
init_plugin_psi_keys();
#endif
......@@ -2333,6 +2337,74 @@ err:
}
static bool plugin_dl_foreach_internal(THD *thd, st_plugin_dl *plugin_dl,
st_maria_plugin *plug,
plugin_foreach_func *func, void *arg)
{
for (; plug->name; plug++)
{
st_plugin_int tmp, *plugin;
tmp.name.str= const_cast<char*>(plug->name);
tmp.name.length= strlen(plug->name);
tmp.plugin= plug;
tmp.plugin_dl= plugin_dl;
mysql_mutex_lock(&LOCK_plugin);
if ((plugin= plugin_find_internal(&tmp.name, MYSQL_ANY_PLUGIN)) &&
plugin->plugin == plug)
{
tmp.state= plugin->state;
tmp.load_option= plugin->load_option;
}
else
{
tmp.state= PLUGIN_IS_FREED;
tmp.load_option= PLUGIN_OFF;
}
mysql_mutex_unlock(&LOCK_plugin);
plugin= &tmp;
if (func(thd, plugin_int_to_ref(plugin), arg))
return 1;
}
return 0;
}
bool plugin_dl_foreach(THD *thd, const LEX_STRING *dl,
plugin_foreach_func *func, void *arg)
{
bool err= 0;
if (dl)
{
mysql_mutex_lock(&LOCK_plugin);
st_plugin_dl *plugin_dl= plugin_dl_add(dl, REPORT_TO_USER);
mysql_mutex_unlock(&LOCK_plugin);
if (!plugin_dl)
return 1;
err= plugin_dl_foreach_internal(thd, plugin_dl, plugin_dl->plugins,
func, arg);
mysql_mutex_lock(&LOCK_plugin);
plugin_dl_del(plugin_dl);
mysql_mutex_unlock(&LOCK_plugin);
}
else
{
struct st_maria_plugin **builtins;
for (builtins= mysql_mandatory_plugins; !err && *builtins; builtins++)
err= plugin_dl_foreach_internal(thd, 0, *builtins, func, arg);
for (builtins= mysql_optional_plugins; !err && *builtins; builtins++)
err= plugin_dl_foreach_internal(thd, 0, *builtins, func, arg);
}
return err;
}
/****************************************************************************
Internal type declarations for variables support
****************************************************************************/
......
......@@ -39,6 +39,8 @@ enum enum_plugin_load_option { PLUGIN_OFF, PLUGIN_ON, PLUGIN_FORCE,
PLUGIN_FORCE_PLUS_PERMANENT };
extern const char *global_plugin_typelib_names[];
extern ulong dlopen_count;
#include <my_sys.h>
#ifdef DBUG_OFF
......@@ -174,4 +176,6 @@ typedef my_bool (plugin_foreach_func)(THD *thd,
#define plugin_foreach(A,B,C,D) plugin_foreach_with_mask(A,B,C,PLUGIN_IS_READY,D)
extern bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
int type, uint state_mask, void *arg);
extern bool plugin_dl_foreach(THD *thd, const LEX_STRING *dl,
plugin_foreach_func *func, void *arg);
#endif
......@@ -119,6 +119,14 @@ append_algorithm(TABLE_LIST *table, String *buff);
static COND * make_cond_for_info_schema(COND *cond, TABLE_LIST *table);
typedef struct st_lookup_field_values
{
LEX_STRING db_value, table_value;
bool wild_db_value, wild_table_value;
} LOOKUP_FIELD_VALUES;
bool get_lookup_field_values(THD *, COND *, TABLE_LIST *, LOOKUP_FIELD_VALUES *);
/***************************************************************************
** List all table types supported
***************************************************************************/
......@@ -157,7 +165,6 @@ static my_bool show_plugins(THD *thd, plugin_ref plugin,
cs);
switch (plugin_state(plugin)) {
/* case PLUGIN_IS_FREED: does not happen */
case PLUGIN_IS_DELETED:
table->field[2]->store(STRING_WITH_LEN("DELETED"), cs);
break;
......@@ -170,6 +177,9 @@ static my_bool show_plugins(THD *thd, plugin_ref plugin,
case PLUGIN_IS_DISABLED:
table->field[2]->store(STRING_WITH_LEN("DISABLED"), cs);
break;
case PLUGIN_IS_FREED: // filtered in fill_plugins, used in fill_all_plugins
table->field[2]->store(STRING_WITH_LEN("NOT INSTALLED"), cs);
break;
default:
DBUG_ASSERT(0);
}
......@@ -267,6 +277,65 @@ int fill_plugins(THD *thd, TABLE_LIST *tables, COND *cond)
}
int fill_all_plugins(THD *thd, TABLE_LIST *tables, COND *cond)
{
DBUG_ENTER("fill_all_plugins");
TABLE *table= tables->table;
LOOKUP_FIELD_VALUES lookup;
if (get_lookup_field_values(thd, cond, tables, &lookup))
DBUG_RETURN(0);
if (lookup.db_value.str && !lookup.db_value.str[0])
DBUG_RETURN(0); // empty string never matches a valid SONAME
MY_DIR *dirp= my_dir(opt_plugin_dir, MY_THREAD_SPECIFIC);
if (!dirp)
{
my_error(ER_CANT_READ_DIR, MYF(0), opt_plugin_dir, my_errno);
DBUG_RETURN(1);
}
if (!lookup.db_value.str)
plugin_dl_foreach(thd, 0, show_plugins, table);
const char *wstr= lookup.db_value.str, *wend= wstr + lookup.db_value.length;
for (uint i=0; i < (uint) dirp->number_of_files; i++)
{
FILEINFO *file= dirp->dir_entry+i;
LEX_STRING dl= { file->name, strlen(file->name) };
const char *dlend= dl.str + dl.length;
const size_t so_ext_len= sizeof(SO_EXT) - 1;
if (strcasecmp(dlend - so_ext_len, SO_EXT))
continue;
if (lookup.db_value.str)
{
if (lookup.wild_db_value)
{
if (my_wildcmp(files_charset_info, dl.str, dlend, wstr, wend,
wild_prefix, wild_one, wild_many))
continue;
}
else
{
if (my_strnncoll(files_charset_info,
(uchar*)dl.str, dl.length,
(uchar*)lookup.db_value.str, lookup.db_value.length))
continue;
}
}
plugin_dl_foreach(thd, &dl, show_plugins, table);
thd->clear_error();
}
my_dirend(dirp);
DBUG_RETURN(0);
}
/***************************************************************************
** List all Authors.
** If you can update it, you get to be in it :)
......@@ -3260,13 +3329,6 @@ void calc_sum_of_all_status(STATUS_VAR *to)
/* This is only used internally, but we need it here as a forward reference */
extern ST_SCHEMA_TABLE schema_tables[];
typedef struct st_lookup_field_values
{
LEX_STRING db_value, table_value;
bool wild_db_value, wild_table_value;
} LOOKUP_FIELD_VALUES;
/*
Store record to I_S table, convert HEAP table
to MyISAM if necessary
......@@ -3587,6 +3649,17 @@ bool get_lookup_field_values(THD *thd, COND *cond, TABLE_LIST *tables,
lookup_field_values->wild_table_value= 1;
}
break;
case SQLCOM_SHOW_PLUGINS:
if (lex->ident.str)
thd->make_lex_string(&lookup_field_values->db_value,
lex->ident.str, lex->ident.length);
else if (lex->wild)
{
thd->make_lex_string(&lookup_field_values->db_value,
lex->wild->ptr(), lex->wild->length());
lookup_field_values->wild_db_value= 1;
}
break;
default:
/*
The "default" is for queries over I_S.
......@@ -8558,7 +8631,7 @@ ST_FIELD_INFO plugin_fields_info[]=
{"PLUGIN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name",
SKIP_OPEN_TABLE},
{"PLUGIN_VERSION", 20, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"PLUGIN_STATUS", 10, MYSQL_TYPE_STRING, 0, 0, "Status", SKIP_OPEN_TABLE},
{"PLUGIN_STATUS", 16, MYSQL_TYPE_STRING, 0, 0, "Status", SKIP_OPEN_TABLE},
{"PLUGIN_TYPE", 80, MYSQL_TYPE_STRING, 0, 0, "Type", SKIP_OPEN_TABLE},
{"PLUGIN_TYPE_VERSION", 20, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"PLUGIN_LIBRARY", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Library",
......@@ -8819,6 +8892,8 @@ ST_SCHEMA_TABLE schema_tables[]=
OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
{"PLUGINS", plugin_fields_info, create_schema_table,
fill_plugins, make_old_format, 0, -1, -1, 0, 0},
{"ALL_PLUGINS", plugin_fields_info, create_schema_table,
fill_all_plugins, make_old_format, 0, 5, -1, 0, 0},
{"PROCESSLIST", processlist_fields_info, create_schema_table,
fill_schema_processlist, make_old_format, 0, -1, -1, 0, 0},
{"PROFILING", query_profile_statistics_info, create_schema_table,
......
......@@ -11449,6 +11449,7 @@ show:
{
LEX *lex=Lex;
lex->wild=0;
lex->ident=null_lex_str;
mysql_init_select(lex);
lex->current_select->parsing_place= SELECT_LIST;
bzero((char*) &lex->create_info,sizeof(lex->create_info));
......@@ -11512,6 +11513,19 @@ show_param:
if (prepare_schema_table(YYTHD, lex, 0, SCH_PLUGINS))
MYSQL_YYABORT;
}
| PLUGINS_SYM SONAME_SYM TEXT_STRING_sys
{
Lex->ident= $3;
Lex->sql_command= SQLCOM_SHOW_PLUGINS;
if (prepare_schema_table(YYTHD, Lex, 0, SCH_ALL_PLUGINS))
MYSQL_YYABORT;
}
| PLUGINS_SYM SONAME_SYM wild_and_where
{
Lex->sql_command= SQLCOM_SHOW_PLUGINS;
if (prepare_schema_table(YYTHD, Lex, 0, SCH_ALL_PLUGINS))
MYSQL_YYABORT;
}
| ENGINE_SYM known_storage_engines show_engine_param
{ Lex->create_info.db_type= $2; }
| ENGINE_SYM ALL show_engine_param
......
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