Skip to content

Commit b6e2973

Browse files
committed
MDEV-14533 Provide information_schema tables using which hardware information can be obtained.
update README, use maria_declare_plugin(), specify the author.
1 parent f5b2761 commit b6e2973

File tree

3 files changed

+12
-26
lines changed

3 files changed

+12
-26
lines changed

plugin/information_schema_disks/README.txt renamed to plugin/disks/README.txt

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,31 +57,16 @@ tables; disks and mounts.
5757
...
5858

5959

60-
Building
61-
--------
62-
- Ensure that the directory information_schema_disks is in the top-level
63-
directory of the server.
64-
- Add
65-
66-
ADD_SUBDIRECTORY(information_schema_disks)
67-
68-
to the top-level CMakeLists.txt
69-
70-
> Invoke make
71-
72-
$ make
73-
7460
Installation
7561
------------
76-
- Copy information_schema_disks/libinformation_schema_disks.so to the plugin
77-
directory of the server:
7862

79-
$ cd information_schema_disks
80-
$ sudo cp libinformation_schema_disks.so plugin-directory-of-server
63+
- Use "install plugin" or "install soname" command:
64+
65+
MariaDB [(none)]> install plugin disks soname 'disks.so';
8166

82-
- Using mysql, install the plugin:
67+
or
8368

84-
MariaDB [(none)]> install plugin disks soname 'libinformation_schema_disks.so';
69+
MariaDB [(none)]> install soname 'disks.so';
8570

8671
Usage
8772
-----

plugin/information_schema_disks/information_schema_disks.cc renamed to plugin/disks/information_schema_disks.cc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
#include <mntent.h>
2020
#include <sql_class.h>
2121
#include <table.h>
22-
#include <innodb_priv.h>
22+
23+
bool schema_table_store_record(THD *thd, TABLE *table);
2324

2425
namespace
2526
{
@@ -133,21 +134,21 @@ int disks_table_init(void *ptr)
133134
extern "C"
134135
{
135136

136-
mysql_declare_plugin(disks_library)
137+
maria_declare_plugin(disks)
137138
{
138139
MYSQL_INFORMATION_SCHEMA_PLUGIN,
139140
&disks_table_info, /* type-specific descriptor */
140141
"DISKS", /* table name */
141-
"MariaDB", /* author */
142+
"Johan Wikman", /* author */
142143
"Disk space information", /* description */
143144
PLUGIN_LICENSE_GPL, /* license type */
144145
disks_table_init, /* init function */
145-
NULL,
146+
NULL, /* deinit function */
146147
0x0100, /* version = 1.0 */
147148
NULL, /* no status variables */
148149
NULL, /* no system variables */
149-
NULL, /* no reserved information */
150-
0 /* no flags */
150+
"1.0", /* String version representation */
151+
MariaDB_PLUGIN_MATURITY_BETA /* Maturity (see include/mysql/plugin.h)*/
151152
}
152153
mysql_declare_plugin_end;
153154

0 commit comments

Comments
 (0)