MDEV-14533 Provide information_schema tables using which hardware information can be obtained.

update README, use maria_declare_plugin(), specify the author.
This commit is contained in:
Sergei Golubchik 2018-03-21 12:59:40 +01:00
parent f5b2761c70
commit b6e2973ee6
3 changed files with 12 additions and 26 deletions

View File

@ -57,31 +57,16 @@ tables; disks and mounts.
... ...
Building
--------
- Ensure that the directory information_schema_disks is in the top-level
directory of the server.
- Add
ADD_SUBDIRECTORY(information_schema_disks)
to the top-level CMakeLists.txt
> Invoke make
$ make
Installation Installation
------------ ------------
- Copy information_schema_disks/libinformation_schema_disks.so to the plugin
directory of the server:
$ cd information_schema_disks - Use "install plugin" or "install soname" command:
$ sudo cp libinformation_schema_disks.so plugin-directory-of-server
- Using mysql, install the plugin: MariaDB [(none)]> install plugin disks soname 'disks.so';
MariaDB [(none)]> install plugin disks soname 'libinformation_schema_disks.so'; or
MariaDB [(none)]> install soname 'disks.so';
Usage Usage
----- -----

View File

@ -19,7 +19,8 @@
#include <mntent.h> #include <mntent.h>
#include <sql_class.h> #include <sql_class.h>
#include <table.h> #include <table.h>
#include <innodb_priv.h>
bool schema_table_store_record(THD *thd, TABLE *table);
namespace namespace
{ {
@ -133,21 +134,21 @@ int disks_table_init(void *ptr)
extern "C" extern "C"
{ {
mysql_declare_plugin(disks_library) maria_declare_plugin(disks)
{ {
MYSQL_INFORMATION_SCHEMA_PLUGIN, MYSQL_INFORMATION_SCHEMA_PLUGIN,
&disks_table_info, /* type-specific descriptor */ &disks_table_info, /* type-specific descriptor */
"DISKS", /* table name */ "DISKS", /* table name */
"MariaDB", /* author */ "Johan Wikman", /* author */
"Disk space information", /* description */ "Disk space information", /* description */
PLUGIN_LICENSE_GPL, /* license type */ PLUGIN_LICENSE_GPL, /* license type */
disks_table_init, /* init function */ disks_table_init, /* init function */
NULL, NULL, /* deinit function */
0x0100, /* version = 1.0 */ 0x0100, /* version = 1.0 */
NULL, /* no status variables */ NULL, /* no status variables */
NULL, /* no system variables */ NULL, /* no system variables */
NULL, /* no reserved information */ "1.0", /* String version representation */
0 /* no flags */ MariaDB_PLUGIN_MATURITY_BETA /* Maturity (see include/mysql/plugin.h)*/
} }
mysql_declare_plugin_end; mysql_declare_plugin_end;