1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-19772 Add helper classes for ST_FIELD_INFO

This commit is contained in:
Alexander Barkov
2019-06-16 07:51:59 +04:00
parent 984d7100cd
commit 4156b1a260
23 changed files with 1143 additions and 978 deletions

View File

@@ -19,25 +19,28 @@
#include <sys/types.h>
#include <mntent.h>
#include <sql_class.h>
#include <table.h>
#include <sql_i_s.h>
bool schema_table_store_record(THD *thd, TABLE *table);
namespace
{
struct st_mysql_information_schema disks_table_info = { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION };
namespace Show {
ST_FIELD_INFO disks_table_fields[]=
{
{ "Disk", PATH_MAX, MYSQL_TYPE_STRING, 0, 0 ,0, 0 },
{ "Path", PATH_MAX, MYSQL_TYPE_STRING, 0, 0 ,0, 0 },
{ "Total", 32, MYSQL_TYPE_LONG, 0, 0 ,0 ,0 }, // Total amount available
{ "Used", 32, MYSQL_TYPE_LONG, 0, 0 ,0 ,0 }, // Amount of space used
{ "Available", 32, MYSQL_TYPE_LONG, 0, 0 ,0 ,0 }, // Amount available to users other than root.
{ 0, 0, MYSQL_TYPE_NULL, 0, 0, 0, 0 }
Column("Disk", Varchar(PATH_MAX), NOT_NULL),
Column("Path", Varchar(PATH_MAX), NOT_NULL),
Column("Total", SLong(32), NOT_NULL), // Total amount available
Column("Used", SLong(32), NOT_NULL), // Amount of space used
Column("Available", SLong(32), NOT_NULL), // Amount available to users other than root.
CEnd()
};
int disks_table_add_row(THD* pThd,
TABLE* pTable,
const char* zDisk,
@@ -130,7 +133,7 @@ int disks_table_init(void *ptr)
return 0;
}
}
} // namespace Show
extern "C"
{
@@ -143,7 +146,7 @@ maria_declare_plugin(disks)
"Johan Wikman", /* author */
"Disk space information", /* description */
PLUGIN_LICENSE_GPL, /* license type */
disks_table_init, /* init function */
Show::disks_table_init, /* init function */
NULL, /* deinit function */
0x0100, /* version = 1.0 */
NULL, /* no status variables */