Commit 85f2217c authored by Olivier Bertrand's avatar Olivier Bertrand

- Update grant tests for new MariaDB version 10.1.44

  modified:   storage/connect/mysql-test/connect/disabled.def
  modified:   storage/connect/mysql-test/connect/r/grant.result
  modified:   storage/connect/mysql-test/connect/r/ini_grant.result
  modified:   storage/connect/mysql-test/connect/r/mysql_grant.result
  modified:   storage/connect/mysql-test/connect/r/xml2_grant.result
  modified:   storage/connect/mysql-test/connect/r/xml_grant.result
  modified:   storage/connect/mysql-test/connect/t/grant.inc
  modified:   storage/connect/mysql-test/connect/t/grant.test
  modified:   storage/connect/mysql-test/connect/t/grant2.test
  modified:   storage/connect/mysql-test/connect/t/ini_grant.test
  modified:   storage/connect/mysql-test/connect/t/mysql_grant.test
parent 54449161
...@@ -20,4 +20,5 @@ mongo_c : Need MongoDB running and its C Driver installed ...@@ -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_2 : Need MongoDB running and its Java Driver installed
mongo_java_3 : 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 tbl_thread : Bug MDEV-9844,10179,14214 03/01/2018 OB Option THREAD removed
grant2 : Until fixed
#vcol : Different error code on different versions #vcol : Different error code on different versions
...@@ -32,7 +32,7 @@ sec val ...@@ -32,7 +32,7 @@ sec val
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; 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'; 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 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT user(); SELECT user();
user() user()
root@localhost root@localhost
...@@ -42,21 +42,21 @@ SELECT user(); ...@@ -42,21 +42,21 @@ SELECT user();
user() user()
user@localhost user@localhost
INSERT INTO t1 VALUES ('sec2','val2'); INSERT INTO t1 VALUES ('sec2','val2');
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1; SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET val='val11'; UPDATE t1 SET val='val11';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1; DELETE FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1; TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1; ALTER TABLE t1 READONLY=1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1; DROP TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1; CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) 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 # Testing a VIEW created with FILE privileges but accessed with no FILE
SELECT user(); SELECT user();
user() user()
...@@ -66,13 +66,13 @@ SELECT user(); ...@@ -66,13 +66,13 @@ SELECT user();
user() user()
user@localhost user@localhost
SELECT * FROM v1; SELECT * FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES ('sec3','val3'); INSERT INTO v1 VALUES ('sec3','val3');
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET val='val11'; UPDATE v1 SET val='val11';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1; DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
DROP USER user@localhost; DROP USER user@localhost;
......
...@@ -9,7 +9,7 @@ SELECT user(); ...@@ -9,7 +9,7 @@ SELECT user();
user() user()
user@localhost user@localhost
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=MySQL OPTION_LIST='host=localhost,user=root1,port=PORT'; CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=MySQL OPTION_LIST='host=localhost,user=root1,port=PORT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT user(); SELECT user();
user() user()
root@localhost root@localhost
...@@ -25,19 +25,19 @@ SELECT user(); ...@@ -25,19 +25,19 @@ SELECT user();
user() user()
user@localhost user@localhost
SELECT * FROM t1; SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO t1 VALUES ('xxx'); INSERT INTO t1 VALUES ('xxx');
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1 WHERE a='xxx'; DELETE FROM t1 WHERE a='xxx';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a='yyy' WHERE a='xxx'; UPDATE t1 SET a='yyy' WHERE a='xxx';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1; TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1; ALTER TABLE t1 READONLY=1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1; CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) 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 # Testing a VIEW created with FILE privileges but accessed with no FILE
SELECT user(); SELECT user();
user() user()
...@@ -47,13 +47,13 @@ SELECT user(); ...@@ -47,13 +47,13 @@ SELECT user();
user() user()
user@localhost user@localhost
SELECT * FROM v1; SELECT * FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2); INSERT INTO v1 VALUES (2);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123; UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1; DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT user(); SELECT user();
user() user()
root@localhost root@localhost
......
...@@ -33,7 +33,7 @@ a ...@@ -33,7 +33,7 @@ a
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=libxml2,rownode=row' FILE_NAME='t1.EXT'; CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=libxml2,rownode=row' FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT user(); SELECT user();
user() user()
root@localhost root@localhost
...@@ -43,23 +43,23 @@ SELECT user(); ...@@ -43,23 +43,23 @@ SELECT user();
user() user()
user@localhost user@localhost
INSERT INTO t1 VALUES (10); INSERT INTO t1 VALUES (10);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1; SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20; UPDATE t1 SET a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1; DELETE FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1; TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1; ALTER TABLE t1 READONLY=1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT'; ALTER TABLE t1 FILE_NAME='t2.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1; DROP TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1; CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) 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 # Testing a VIEW created with FILE privileges but accessed with no FILE
SELECT user(); SELECT user();
user() user()
...@@ -69,13 +69,13 @@ SELECT user(); ...@@ -69,13 +69,13 @@ SELECT user();
user() user()
user@localhost user@localhost
SELECT * FROM v1; SELECT * FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2); INSERT INTO v1 VALUES (2);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123; UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1; DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT user(); SELECT user();
user() user()
root@localhost root@localhost
...@@ -89,7 +89,7 @@ SELECT user(); ...@@ -89,7 +89,7 @@ SELECT user();
user() user()
user@localhost user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT'; ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1; DROP TABLE t1;
DROP USER user@localhost; DROP USER user@localhost;
# #
......
...@@ -31,7 +31,7 @@ a ...@@ -31,7 +31,7 @@ a
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=domdoc,rownode=row' FILE_NAME='t1.EXT'; CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=domdoc,rownode=row' FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT user(); SELECT user();
user() user()
root@localhost root@localhost
...@@ -41,23 +41,23 @@ SELECT user(); ...@@ -41,23 +41,23 @@ SELECT user();
user() user()
user@localhost user@localhost
INSERT INTO t1 VALUES (10); INSERT INTO t1 VALUES (10);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT * FROM t1; SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE t1 SET a=20; UPDATE t1 SET a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM t1; DELETE FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
TRUNCATE TABLE t1; TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 READONLY=1; ALTER TABLE t1 READONLY=1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
ALTER TABLE t1 FILE_NAME='t2.EXT'; ALTER TABLE t1 FILE_NAME='t2.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1; DROP TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
CREATE VIEW v1 AS SELECT * FROM t1; CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) 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 # Testing a VIEW created with FILE privileges but accessed with no FILE
SELECT user(); SELECT user();
user() user()
...@@ -67,13 +67,13 @@ SELECT user(); ...@@ -67,13 +67,13 @@ SELECT user();
user() user()
user@localhost user@localhost
SELECT * FROM v1; SELECT * FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
INSERT INTO v1 VALUES (2); INSERT INTO v1 VALUES (2);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
UPDATE v1 SET a=123; UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DELETE FROM v1; DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
SELECT user(); SELECT user();
user() user()
root@localhost root@localhost
...@@ -87,7 +87,7 @@ SELECT user(); ...@@ -87,7 +87,7 @@ SELECT user();
user() user()
user@localhost user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT'; ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO) ERROR 42000: Access denied; you need (at least one of) the FILE privilege(s) for this operation
DROP TABLE t1; DROP TABLE t1;
DROP USER user@localhost; DROP USER user@localhost;
# #
......
...@@ -25,7 +25,7 @@ DROP TABLE t1; ...@@ -25,7 +25,7 @@ DROP TABLE t1;
# Making sure DROP erased the data file # Making sure DROP erased the data file
--error 1 --error 1
--remove_file $MYSQLD_DATADIR/test/t1.$FILE_EXT --remove_file $MYSQLD_DATADIR/test/t1.$FILE_EXT
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT $TABLE_OPTIONS FILE_NAME='t1.EXT' --eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT $TABLE_OPTIONS FILE_NAME='t1.EXT'
--connection default --connection default
SELECT user(); SELECT user();
...@@ -33,23 +33,23 @@ SELECT user(); ...@@ -33,23 +33,23 @@ SELECT user();
INSERT INTO t1 VALUES (10); INSERT INTO t1 VALUES (10);
--connection user --connection user
SELECT user(); SELECT user();
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 VALUES (10); INSERT INTO t1 VALUES (10);
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM t1; SELECT * FROM t1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 SET a=20; UPDATE t1 SET a=20;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM t1; DELETE FROM t1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
TRUNCATE TABLE t1; TRUNCATE TABLE t1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 READONLY=1; ALTER TABLE t1 READONLY=1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 FILE_NAME='t2.EXT'; ALTER TABLE t1 FILE_NAME='t2.EXT';
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
DROP TABLE t1; DROP TABLE t1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v1 AS SELECT * FROM t1; CREATE VIEW v1 AS SELECT * FROM t1;
--echo # Testing a VIEW created with FILE privileges but accessed with no FILE --echo # Testing a VIEW created with FILE privileges but accessed with no FILE
--connection default --connection default
...@@ -57,13 +57,13 @@ SELECT user(); ...@@ -57,13 +57,13 @@ SELECT user();
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1; CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
--connection user --connection user
SELECT user(); SELECT user();
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1; SELECT * FROM v1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1 VALUES (2); INSERT INTO v1 VALUES (2);
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1 SET a=123; UPDATE v1 SET a=123;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM v1; DELETE FROM v1;
--connection default --connection default
SELECT user(); SELECT user();
...@@ -74,7 +74,7 @@ DROP TABLE t1; ...@@ -74,7 +74,7 @@ DROP TABLE t1;
INSERT INTO t1 VALUES (10); INSERT INTO t1 VALUES (10);
--connection user --connection user
SELECT user(); SELECT user();
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 FILE_NAME='t1.EXT'; ALTER TABLE t1 FILE_NAME='t1.EXT';
--connection default --connection default
DROP TABLE t1; DROP TABLE t1;
......
...@@ -11,7 +11,7 @@ REVOKE FILE ON *.* FROM user@localhost; ...@@ -11,7 +11,7 @@ REVOKE FILE ON *.* FROM user@localhost;
--connect(user,localhost,user,,) --connect(user,localhost,user,,)
--connection user --connection user
SELECT user(); SELECT user();
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE TABLE t1 ( CREATE TABLE t1 (
path VARCHAR(256) NOT NULL flag=1, path VARCHAR(256) NOT NULL flag=1,
fname VARCHAR(256) NOT NULL, fname VARCHAR(256) NOT NULL,
...@@ -28,23 +28,24 @@ CREATE TABLE t1 ( ...@@ -28,23 +28,24 @@ CREATE TABLE t1 (
) ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*.*'; ) ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*.*';
# "size>0" to skip directory names on Windows # "size>0" to skip directory names on Windows
--replace_result $MYSQLD_DATADIR DATADIR/ --replace_result $MYSQLD_DATADIR DATADIR/
--sorted_result
SELECT fname, ftype, size FROM t1 WHERE size>0; SELECT fname, ftype, size FROM t1 WHERE size>0;
--connection user --connection user
SELECT user(); SELECT user();
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM t1; SELECT * FROM t1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 VALUES (); INSERT INTO t1 VALUES ();
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM t1 WHERE path='xxx'; DELETE FROM t1 WHERE path='xxx';
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 SET path='yyy' WHERE path='xxx'; UPDATE t1 SET path='yyy' WHERE path='xxx';
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
TRUNCATE TABLE t1; TRUNCATE TABLE t1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 READONLY=1; ALTER TABLE t1 READONLY=1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v1 AS SELECT * FROM t1; CREATE VIEW v1 AS SELECT * FROM t1;
--echo # Testing a VIEW created with FILE privileges but accessed with no FILE --echo # Testing a VIEW created with FILE privileges but accessed with no FILE
...@@ -53,13 +54,13 @@ SELECT user(); ...@@ -53,13 +54,13 @@ SELECT user();
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1; CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
--connection user --connection user
SELECT user(); SELECT user();
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1; SELECT * FROM v1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1 VALUES (1,1,1,1); INSERT INTO v1 VALUES (1,1,1,1);
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1 SET path=123; UPDATE v1 SET path=123;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM v1; DELETE FROM v1;
--disconnect user --disconnect user
......
#
# 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
#
...@@ -29,7 +29,7 @@ DROP TABLE t1; ...@@ -29,7 +29,7 @@ DROP TABLE t1;
# Making sure DROP erased the data file # Making sure DROP erased the data file
--error 1 --error 1
--remove_file $MYSQLD_DATADIR/test/t1.ini --remove_file $MYSQLD_DATADIR/test/t1.ini
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT'; CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
--connection default --connection default
SELECT user(); SELECT user();
...@@ -37,21 +37,21 @@ CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CON ...@@ -37,21 +37,21 @@ CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CON
INSERT INTO t1 VALUES ('sec1','val1'); INSERT INTO t1 VALUES ('sec1','val1');
--connection user --connection user
SELECT user(); SELECT user();
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 VALUES ('sec2','val2'); INSERT INTO t1 VALUES ('sec2','val2');
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM t1; SELECT * FROM t1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 SET val='val11'; UPDATE t1 SET val='val11';
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM t1; DELETE FROM t1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
TRUNCATE TABLE t1; TRUNCATE TABLE t1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 READONLY=1; ALTER TABLE t1 READONLY=1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
DROP TABLE t1; DROP TABLE t1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v1 AS SELECT * FROM t1; CREATE VIEW v1 AS SELECT * FROM t1;
--echo # Testing a VIEW created with FILE privileges but accessed with no FILE --echo # Testing a VIEW created with FILE privileges but accessed with no FILE
--connection default --connection default
...@@ -59,13 +59,13 @@ SELECT user(); ...@@ -59,13 +59,13 @@ SELECT user();
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1; CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
--connection user --connection user
SELECT user(); SELECT user();
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1; SELECT * FROM v1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1 VALUES ('sec3','val3'); INSERT INTO v1 VALUES ('sec3','val3');
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1 SET val='val11'; UPDATE v1 SET val='val11';
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM v1; DELETE FROM v1;
--disconnect user --disconnect user
--connection default --connection default
......
...@@ -27,7 +27,7 @@ set sql_mode=default; ...@@ -27,7 +27,7 @@ set sql_mode=default;
--connection user --connection user
SELECT user(); SELECT user();
--replace_result $PORT PORT --replace_result $PORT PORT
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=MySQL OPTION_LIST='host=localhost,user=root1,port=$PORT' --eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=MySQL OPTION_LIST='host=localhost,user=root1,port=$PORT'
--connection default --connection default
SELECT user(); SELECT user();
...@@ -38,19 +38,19 @@ INSERT INTO t1remote VALUES (10),(20),(30); ...@@ -38,19 +38,19 @@ INSERT INTO t1remote VALUES (10),(20),(30);
SELECT * FROM t1; SELECT * FROM t1;
--connection user --connection user
SELECT user(); SELECT user();
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM t1; SELECT * FROM t1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO t1 VALUES ('xxx'); INSERT INTO t1 VALUES ('xxx');
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM t1 WHERE a='xxx'; DELETE FROM t1 WHERE a='xxx';
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE t1 SET a='yyy' WHERE a='xxx'; UPDATE t1 SET a='yyy' WHERE a='xxx';
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
TRUNCATE TABLE t1; TRUNCATE TABLE t1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
ALTER TABLE t1 READONLY=1; ALTER TABLE t1 READONLY=1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
CREATE VIEW v1 AS SELECT * FROM t1; CREATE VIEW v1 AS SELECT * FROM t1;
--echo # Testing a VIEW created with FILE privileges but accessed with no FILE --echo # Testing a VIEW created with FILE privileges but accessed with no FILE
...@@ -59,13 +59,13 @@ SELECT user(); ...@@ -59,13 +59,13 @@ SELECT user();
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1; CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
--connection user --connection user
SELECT user(); SELECT user();
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM v1; SELECT * FROM v1;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
INSERT INTO v1 VALUES (2); INSERT INTO v1 VALUES (2);
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
UPDATE v1 SET a=123; UPDATE v1 SET a=123;
--error ER_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
DELETE FROM v1; DELETE FROM v1;
--disconnect user --disconnect user
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment