1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge 10.2 into 10.3

This commit is contained in:
Marko Mäkelä
2019-07-02 17:46:22 +03:00
320 changed files with 23190 additions and 7611 deletions

View File

@ -20,6 +20,7 @@
#include <mntent.h>
#include <sql_class.h>
#include <table.h>
#include <sql_acl.h> /* check_global_access() */
bool schema_table_store_record(THD *thd, TABLE *table);
@ -84,6 +85,9 @@ int disks_fill_table(THD* pThd, TABLE_LIST* pTables, Item* pCond)
int rv = 1;
TABLE* pTable = pTables->table;
if (check_global_access(pThd, FILE_ACL, true))
return 0;
FILE* pFile = setmntent("/etc/mtab", "r");
if (pFile)
@ -145,11 +149,11 @@ maria_declare_plugin(disks)
PLUGIN_LICENSE_GPL, /* license type */
disks_table_init, /* init function */
NULL, /* deinit function */
0x0100, /* version = 1.0 */
0x0101, /* version = 1.1 */
NULL, /* no status variables */
NULL, /* no system variables */
"1.0", /* String version representation */
MariaDB_PLUGIN_MATURITY_BETA /* Maturity (see include/mysql/plugin.h)*/
"1.1", /* String version representation */
MariaDB_PLUGIN_MATURITY_STABLE /* Maturity (see include/mysql/plugin.h)*/
}
mysql_declare_plugin_end;

View File

@ -0,0 +1,22 @@
#
# MDEV-18328: Make DISKS plugin check some privilege to access
# information_schema.DISKS table
#
CREATE USER user1@localhost;
GRANT SELECT ON *.* TO user1@localhost;
connect con1,localhost,user1,,;
connection con1;
select sum(Total) > sum(Available), sum(Total)>sum(Used) from information_schema.disks;
sum(Total) > sum(Available) sum(Total)>sum(Used)
NULL NULL
disconnect con1;
connection default;
GRANT FILE ON *.* TO user1@localhost;
connect con1,localhost,user1,,;
connection con1;
select sum(Total) > sum(Available), sum(Total)>sum(Used) from information_schema.disks;
sum(Total) > sum(Available) sum(Total)>sum(Used)
1 1
connection default;
DROP USER user1@localhost;
# End of 10.1 tests

View File

@ -0,0 +1,25 @@
source include/not_embedded.inc;
--echo #
--echo # MDEV-18328: Make DISKS plugin check some privilege to access
--echo # information_schema.DISKS table
--echo #
CREATE USER user1@localhost;
GRANT SELECT ON *.* TO user1@localhost;
connect (con1,localhost,user1,,);
connection con1;
select sum(Total) > sum(Available), sum(Total)>sum(Used) from information_schema.disks;
disconnect con1;
connection default;
GRANT FILE ON *.* TO user1@localhost;
connect (con1,localhost,user1,,);
connection con1;
select sum(Total) > sum(Available), sum(Total)>sum(Used) from information_schema.disks;
connection default;
DROP USER user1@localhost;
--echo # End of 10.1 tests