summaryrefslogtreecommitdiff
path: root/storage/connect/mysql-test
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2020-01-20 16:15:05 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2020-01-20 16:15:05 +0100
commit3a1716a7e79e6fe05a166211002321f73465ec79 (patch)
tree8b9eeab4e037c893ea4cd994b5a7d9e1b1825f5b /storage/connect/mysql-test
parentd07664498be9c71c01c7df9f2fb1d18c7060b2e3 (diff)
parent7993f893b844d71183956ee30a6fb37fc10ae90c (diff)
downloadmariadb-git-3a1716a7e79e6fe05a166211002321f73465ec79.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'storage/connect/mysql-test')
-rw-r--r--storage/connect/mysql-test/connect/disabled.def1
-rw-r--r--storage/connect/mysql-test/connect/t/ini_grant.result89
2 files changed, 90 insertions, 0 deletions
diff --git a/storage/connect/mysql-test/connect/disabled.def b/storage/connect/mysql-test/connect/disabled.def
index 1de4deb0a60..a4d629fc3d1 100644
--- a/storage/connect/mysql-test/connect/disabled.def
+++ b/storage/connect/mysql-test/connect/disabled.def
@@ -20,4 +20,5 @@ mongo_c : Need MongoDB running and its C Driver installed
mongo_java_2 : Need MongoDB running and its Java Driver installed
mongo_java_3 : Need MongoDB running and its Java Driver installed
tbl_thread : Bug MDEV-9844,10179,14214 03/01/2018 OB Option THREAD removed
+grant2 : Until fixed
#vcol : Different error code on different versions
diff --git a/storage/connect/mysql-test/connect/t/ini_grant.result b/storage/connect/mysql-test/connect/t/ini_grant.result
new file mode 100644
index 00000000000..96d5e192c7d
--- /dev/null
+++ b/storage/connect/mysql-test/connect/t/ini_grant.result
@@ -0,0 +1,89 @@
+#
+# Checking FILE privileges
+#
+set sql_mode="";
+GRANT ALL PRIVILEGES ON *.* TO user@localhost;
+REVOKE FILE ON *.* FROM user@localhost;
+set sql_mode=default;
+connect user,localhost,user,,;
+connection user;
+SELECT user();
+user()
+user@localhost
+CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI;
+Warnings:
+Warning 1105 No file name. Table will use t1.ini
+INSERT INTO t1 VALUES ('sec1','val1');
+SELECT * FROM t1;
+sec val
+sec1 val1
+UPDATE t1 SET val='val11';
+SELECT * FROM t1;
+sec val
+sec1 val11
+DELETE FROM t1;
+SELECT * FROM t1;
+sec val
+INSERT INTO t1 VALUES('sec2','val2');
+TRUNCATE TABLE t1;
+SELECT * FROM t1;
+sec val
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT * FROM v1;
+sec val
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+connection default;
+SELECT user();
+user()
+root@localhost
+CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
+INSERT INTO t1 VALUES ('sec1','val1');
+connection user;
+SELECT user();
+user()
+user@localhost
+INSERT INTO t1 VALUES ('sec2','val2');
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+SELECT * FROM t1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+UPDATE t1 SET val='val11';
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+DELETE FROM t1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+TRUNCATE TABLE t1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+ALTER TABLE t1 READONLY=1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+DROP TABLE t1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+CREATE VIEW v1 AS SELECT * FROM t1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+# Testing a VIEW created with FILE privileges but accessed with no FILE
+connection default;
+SELECT user();
+user()
+root@localhost
+CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
+connection user;
+SELECT user();
+user()
+user@localhost
+SELECT * FROM v1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+INSERT INTO v1 VALUES ('sec3','val3');
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+UPDATE v1 SET val='val11';
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+DELETE FROM v1;
+ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
+disconnect user;
+connection default;
+DROP VIEW v1;
+DROP TABLE t1;
+DROP USER user@localhost;
+#
+# Checking FILE privileges: done
+#