summaryrefslogtreecommitdiff
path: root/plugin/disks
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2018-03-24 00:30:28 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2018-03-24 00:30:28 +0400
commit3b644ac1f71f2259f66f53a19c78eed90f7a692c (patch)
tree85e877beed470c421a5837b487e5cd275655a0fc /plugin/disks
parentfebe1e850342ea52ce0900ba5767852b0aa42dc7 (diff)
downloadmariadb-git-3b644ac1f71f2259f66f53a19c78eed90f7a692c.tar.gz
MDEV-14533 Provide information_schema tables using which hardware
information can be obtained. disks.test moved to plugin's directory.
Diffstat (limited to 'plugin/disks')
-rw-r--r--plugin/disks/mysql-test/disks/disks.result14
-rw-r--r--plugin/disks/mysql-test/disks/disks.test11
-rw-r--r--plugin/disks/mysql-test/disks/suite.opt1
-rw-r--r--plugin/disks/mysql-test/disks/suite.pm10
4 files changed, 36 insertions, 0 deletions
diff --git a/plugin/disks/mysql-test/disks/disks.result b/plugin/disks/mysql-test/disks/disks.result
new file mode 100644
index 00000000000..53e73ec6f66
--- /dev/null
+++ b/plugin/disks/mysql-test/disks/disks.result
@@ -0,0 +1,14 @@
+install plugin DISKS soname 'disks';
+show create table information_schema.disks;
+Table Create Table
+DISKS CREATE TEMPORARY TABLE `DISKS` (
+ `Disk` varchar(4096) NOT NULL DEFAULT '',
+ `Path` varchar(4096) NOT NULL DEFAULT '',
+ `Total` int(32) NOT NULL DEFAULT '0',
+ `Used` int(32) NOT NULL DEFAULT '0',
+ `Available` int(32) NOT NULL DEFAULT '0'
+) ENGINE=MEMORY DEFAULT CHARSET=utf8
+select sum(Total) > sum(Available), sum(Total)>sum(Used) from information_schema.disks;
+sum(Total) > sum(Available) sum(Total)>sum(Used)
+1 1
+uninstall plugin DISKS;
diff --git a/plugin/disks/mysql-test/disks/disks.test b/plugin/disks/mysql-test/disks/disks.test
new file mode 100644
index 00000000000..a2371b97584
--- /dev/null
+++ b/plugin/disks/mysql-test/disks/disks.test
@@ -0,0 +1,11 @@
+--source include/not_windows.inc
+
+if (!$DISKS_SO) {
+ skip No DISKS plugin;
+}
+
+install plugin DISKS soname 'disks';
+show create table information_schema.disks;
+select sum(Total) > sum(Available), sum(Total)>sum(Used) from information_schema.disks;
+
+uninstall plugin DISKS;
diff --git a/plugin/disks/mysql-test/disks/suite.opt b/plugin/disks/mysql-test/disks/suite.opt
new file mode 100644
index 00000000000..afbbe2b0163
--- /dev/null
+++ b/plugin/disks/mysql-test/disks/suite.opt
@@ -0,0 +1 @@
+--plugin-load-add=$DISKS_SO
diff --git a/plugin/disks/mysql-test/disks/suite.pm b/plugin/disks/mysql-test/disks/suite.pm
new file mode 100644
index 00000000000..c64ef3b3133
--- /dev/null
+++ b/plugin/disks/mysql-test/disks/suite.pm
@@ -0,0 +1,10 @@
+package My::Suite::Disks;
+
+@ISA = qw(My::Suite);
+
+return "No Disks plugin" unless $ENV{DISKS_SO};
+
+sub is_default { 1 }
+
+bless { };
+