Skip to content
Permalink
Browse files
MDEV-14533 Provide information_schema tables using which hardware inf…
…ormation can be obtained.

update README, use maria_declare_plugin(), specify the author.
  • Loading branch information
vuvova committed Mar 22, 2018
1 parent f5b2761 commit b6e2973
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 26 deletions.
File renamed without changes.
@@ -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
------------
- Copy information_schema_disks/libinformation_schema_disks.so to the plugin
directory of the server:

$ cd information_schema_disks
$ sudo cp libinformation_schema_disks.so plugin-directory-of-server
- Use "install plugin" or "install soname" command:

MariaDB [(none)]> install plugin disks soname 'disks.so';

- Using mysql, install the plugin:
or

MariaDB [(none)]> install plugin disks soname 'libinformation_schema_disks.so';
MariaDB [(none)]> install soname 'disks.so';

Usage
-----
@@ -19,7 +19,8 @@
#include <mntent.h>
#include <sql_class.h>
#include <table.h>
#include <innodb_priv.h>

bool schema_table_store_record(THD *thd, TABLE *table);

namespace
{
@@ -133,21 +134,21 @@ int disks_table_init(void *ptr)
extern "C"
{

mysql_declare_plugin(disks_library)
maria_declare_plugin(disks)
{
MYSQL_INFORMATION_SCHEMA_PLUGIN,
&disks_table_info, /* type-specific descriptor */
"DISKS", /* table name */
"MariaDB", /* author */
"Johan Wikman", /* author */
"Disk space information", /* description */
PLUGIN_LICENSE_GPL, /* license type */
disks_table_init, /* init function */
NULL,
NULL, /* deinit function */
0x0100, /* version = 1.0 */
NULL, /* no status variables */
NULL, /* no system variables */
NULL, /* no reserved information */
0 /* no flags */
"1.0", /* String version representation */
MariaDB_PLUGIN_MATURITY_BETA /* Maturity (see include/mysql/plugin.h)*/
}
mysql_declare_plugin_end;

0 comments on commit b6e2973

Please sign in to comment.