Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
be780c05
Commit
be780c05
authored
Sep 10, 2019
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix CONNECT engine to issue the correct error message
parent
42ada915
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
460 additions
and
481 deletions
+460
-481
storage/connect/ha_connect.cc
storage/connect/ha_connect.cc
+7
-28
storage/connect/mysql-test/connect/r/grant.result
storage/connect/mysql-test/connect/r/grant.result
+87
-87
storage/connect/mysql-test/connect/r/grant2.result
storage/connect/mysql-test/connect/r/grant2.result
+129
-129
storage/connect/mysql-test/connect/r/ini_grant.result
storage/connect/mysql-test/connect/r/ini_grant.result
+13
-13
storage/connect/mysql-test/connect/r/mysql_grant.result
storage/connect/mysql-test/connect/r/mysql_grant.result
+12
-12
storage/connect/mysql-test/connect/r/xml2_grant.result
storage/connect/mysql-test/connect/r/xml2_grant.result
+15
-15
storage/connect/mysql-test/connect/r/xml_grant.result
storage/connect/mysql-test/connect/r/xml_grant.result
+15
-15
storage/connect/mysql-test/connect/t/grant.inc
storage/connect/mysql-test/connect/t/grant.inc
+15
-15
storage/connect/mysql-test/connect/t/grant.test
storage/connect/mysql-test/connect/t/grant.test
+12
-12
storage/connect/mysql-test/connect/t/grant2.test
storage/connect/mysql-test/connect/t/grant2.test
+130
-130
storage/connect/mysql-test/connect/t/ini_grant.test
storage/connect/mysql-test/connect/t/ini_grant.test
+13
-13
storage/connect/mysql-test/connect/t/mysql_grant.test
storage/connect/mysql-test/connect/t/mysql_grant.test
+12
-12
No files found.
storage/connect/ha_connect.cc
View file @
be780c05
...
...
@@ -4503,34 +4503,13 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn, bool quick)
case
TAB_DIR
:
case
TAB_ZIP
:
case
TAB_OEM
:
#ifdef NO_EMBEDDED_ACCESS_CHECKS
return
false
;
#endif
/*
Check FILE_ACL
If table or table->mdl_ticket is NULL - it's a DLL, e.g. CREATE TABLE.
if the table has an MDL_EXCLUSIVE lock - it's a DDL too, e.g. the
insert step of CREATE ... SELECT.
Otherwise it's a DML, the table was normally opened, locked,
privilege were already checked, and table->grant.privilege is set.
With SQL SECURITY DEFINER, table->grant.privilege has definer's privileges.
Unless we're in prelocking mode, in this case table->grant.privilege
is only checked in start_stmt(), not in external_lock().
*/
if
(
!
table
||
!
table
->
mdl_ticket
||
table
->
mdl_ticket
->
get_type
()
==
MDL_EXCLUSIVE
)
return
check_access
(
thd
,
FILE_ACL
,
db
,
NULL
,
NULL
,
0
,
0
);
if
((
!
quick
&&
thd
->
lex
->
requires_prelocking
())
||
table
->
grant
.
privilege
&
FILE_ACL
)
return
false
;
status_var_increment
(
thd
->
status_var
.
access_denied_errors
);
my_error
(
access_denied_error_code
(
thd
->
password
),
MYF
(
0
),
thd
->
security_ctx
->
priv_user
,
thd
->
security_ctx
->
priv_host
,
(
thd
->
password
?
ER
(
ER_YES
)
:
ER
(
ER_NO
)));
return
true
;
if
(
table
&&
table
->
pos_in_table_list
)
// if SELECT
{
Switch_to_definer_security_ctx
backup_ctx
(
thd
,
table
->
pos_in_table_list
);
return
check_global_access
(
thd
,
FILE_ACL
);
}
else
return
check_global_access
(
thd
,
FILE_ACL
);
case
TAB_ODBC
:
case
TAB_JDBC
:
case
TAB_MONGO
:
...
...
storage/connect/mysql-test/connect/r/grant.result
View file @
be780c05
This diff is collapsed.
Click to expand it.
storage/connect/mysql-test/connect/r/grant2.result
View file @
be780c05
This diff is collapsed.
Click to expand it.
storage/connect/mysql-test/connect/r/ini_grant.result
View file @
be780c05
...
...
@@ -34,7 +34,7 @@ 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
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
connection default;
SELECT user();
user()
...
...
@@ -46,21 +46,21 @@ SELECT user();
user()
user@localhost
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;
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';
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;
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;
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;
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;
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;
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
connection default;
SELECT user();
...
...
@@ -72,13 +72,13 @@ SELECT user();
user()
user@localhost
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');
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';
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;
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
disconnect user;
connection default;
DROP VIEW v1;
...
...
storage/connect/mysql-test/connect/r/mysql_grant.result
View file @
be780c05
...
...
@@ -11,7 +11,7 @@ SELECT user();
user()
user@localhost
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
connection default;
SELECT user();
user()
...
...
@@ -29,19 +29,19 @@ SELECT user();
user()
user@localhost
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');
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';
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';
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;
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;
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;
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
connection default;
SELECT user();
...
...
@@ -53,13 +53,13 @@ SELECT user();
user()
user@localhost
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);
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;
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;
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
disconnect user;
connection default;
SELECT user();
...
...
storage/connect/mysql-test/connect/r/xml2_grant.result
View file @
be780c05
...
...
@@ -35,7 +35,7 @@ a
DROP VIEW v1;
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';
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
connection default;
SELECT user();
user()
...
...
@@ -47,23 +47,23 @@ SELECT user();
user()
user@localhost
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;
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;
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;
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;
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;
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';
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;
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;
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
connection default;
SELECT user();
...
...
@@ -75,13 +75,13 @@ SELECT user();
user()
user@localhost
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);
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;
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;
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
connection default;
SELECT user();
user()
...
...
@@ -97,7 +97,7 @@ SELECT user();
user()
user@localhost
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
connection default;
DROP TABLE t1;
disconnect user;
...
...
storage/connect/mysql-test/connect/r/xml_grant.result
View file @
be780c05
...
...
@@ -33,7 +33,7 @@ a
DROP VIEW v1;
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';
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
connection default;
SELECT user();
user()
...
...
@@ -45,23 +45,23 @@ SELECT user();
user()
user@localhost
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;
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;
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;
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;
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;
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';
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;
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;
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
connection default;
SELECT user();
...
...
@@ -73,13 +73,13 @@ SELECT user();
user()
user@localhost
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);
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;
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;
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
connection default;
SELECT user();
user()
...
...
@@ -95,7 +95,7 @@ SELECT user();
user()
user@localhost
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
connection default;
DROP TABLE t1;
disconnect user;
...
...
storage/connect/mysql-test/connect/t/grant.inc
View file @
be780c05
...
...
@@ -25,7 +25,7 @@ DROP TABLE t1;
# Making sure DROP erased the data file
--
error
1
--
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'
--
connection
default
SELECT
user
();
...
...
@@ -33,23 +33,23 @@ SELECT user();
INSERT
INTO
t1
VALUES
(
10
);
--
connection
user
SELECT
user
();
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
INSERT
INTO
t1
VALUES
(
10
);
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
SELECT
*
FROM
t1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
UPDATE
t1
SET
a
=
20
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
DELETE
FROM
t1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
TRUNCATE
TABLE
t1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
ALTER
TABLE
t1
READONLY
=
1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
ALTER
TABLE
t1
FILE_NAME
=
't2.EXT'
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
DROP
TABLE
t1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
CREATE
VIEW
v1
AS
SELECT
*
FROM
t1
;
--
echo
# Testing a VIEW created with FILE privileges but accessed with no FILE
--
connection
default
...
...
@@ -57,13 +57,13 @@ SELECT user();
CREATE
SQL
SECURITY
INVOKER
VIEW
v1
AS
SELECT
*
FROM
t1
;
--
connection
user
SELECT
user
();
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
SELECT
*
FROM
v1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
INSERT
INTO
v1
VALUES
(
2
);
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
UPDATE
v1
SET
a
=
123
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
DELETE
FROM
v1
;
--
connection
default
SELECT
user
();
...
...
@@ -74,7 +74,7 @@ DROP TABLE t1;
INSERT
INTO
t1
VALUES
(
10
);
--
connection
user
SELECT
user
();
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
ALTER
TABLE
t1
FILE_NAME
=
't1.EXT'
;
--
connection
default
DROP
TABLE
t1
;
...
...
storage/connect/mysql-test/connect/t/grant.test
View file @
be780c05
...
...
@@ -11,7 +11,7 @@ REVOKE FILE ON *.* FROM user@localhost;
--
connect
(
user
,
localhost
,
user
,,)
--
connection
user
SELECT
user
();
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
CREATE
TABLE
t1
(
path
VARCHAR
(
256
)
NOT
NULL
flag
=
1
,
fname
VARCHAR
(
256
)
NOT
NULL
,
...
...
@@ -33,19 +33,19 @@ SELECT fname, ftype, size FROM t1 WHERE size>0;
--
connection
user
SELECT
user
();
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
SELECT
*
FROM
t1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
INSERT
INTO
t1
VALUES
();
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
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'
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
TRUNCATE
TABLE
t1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
ALTER
TABLE
t1
READONLY
=
1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
CREATE
VIEW
v1
AS
SELECT
*
FROM
t1
;
--
echo
# Testing a VIEW created with FILE privileges but accessed with no FILE
...
...
@@ -54,13 +54,13 @@ SELECT user();
CREATE
SQL
SECURITY
INVOKER
VIEW
v1
AS
SELECT
*
FROM
t1
;
--
connection
user
SELECT
user
();
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
SELECT
*
FROM
v1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
INSERT
INTO
v1
VALUES
(
1
,
1
,
1
,
1
);
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
UPDATE
v1
SET
path
=
123
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
DELETE
FROM
v1
;
--
disconnect
user
...
...
storage/connect/mysql-test/connect/t/grant2.test
View file @
be780c05
This diff is collapsed.
Click to expand it.
storage/connect/mysql-test/connect/t/ini_grant.test
View file @
be780c05
...
...
@@ -29,7 +29,7 @@ DROP TABLE t1;
# Making sure DROP erased the data file
--
error
1
--
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'
;
--
connection
default
SELECT
user
();
...
...
@@ -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'
);
--
connection
user
SELECT
user
();
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
INSERT
INTO
t1
VALUES
(
'sec2'
,
'val2'
);
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
SELECT
*
FROM
t1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
UPDATE
t1
SET
val
=
'val11'
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
DELETE
FROM
t1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
TRUNCATE
TABLE
t1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
ALTER
TABLE
t1
READONLY
=
1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
DROP
TABLE
t1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
CREATE
VIEW
v1
AS
SELECT
*
FROM
t1
;
--
echo
# Testing a VIEW created with FILE privileges but accessed with no FILE
--
connection
default
...
...
@@ -59,13 +59,13 @@ SELECT user();
CREATE
SQL
SECURITY
INVOKER
VIEW
v1
AS
SELECT
*
FROM
t1
;
--
connection
user
SELECT
user
();
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
SELECT
*
FROM
v1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
INSERT
INTO
v1
VALUES
(
'sec3'
,
'val3'
);
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
UPDATE
v1
SET
val
=
'val11'
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
DELETE
FROM
v1
;
--
disconnect
user
--
connection
default
...
...
storage/connect/mysql-test/connect/t/mysql_grant.test
View file @
be780c05
...
...
@@ -27,7 +27,7 @@ set sql_mode=default;
--
connection
user
SELECT
user
();
--
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'
--
connection
default
SELECT
user
();
...
...
@@ -38,19 +38,19 @@ INSERT INTO t1remote VALUES (10),(20),(30);
SELECT
*
FROM
t1
;
--
connection
user
SELECT
user
();
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
SELECT
*
FROM
t1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
INSERT
INTO
t1
VALUES
(
'xxx'
);
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
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'
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
TRUNCATE
TABLE
t1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
ALTER
TABLE
t1
READONLY
=
1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
CREATE
VIEW
v1
AS
SELECT
*
FROM
t1
;
--
echo
# Testing a VIEW created with FILE privileges but accessed with no FILE
...
...
@@ -59,13 +59,13 @@ SELECT user();
CREATE
SQL
SECURITY
INVOKER
VIEW
v1
AS
SELECT
*
FROM
t1
;
--
connection
user
SELECT
user
();
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
SELECT
*
FROM
v1
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
INSERT
INTO
v1
VALUES
(
2
);
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
UPDATE
v1
SET
a
=
123
;
--
error
ER_ACCESS_DENIED_ERROR
--
error
ER_
SPECIFIC_
ACCESS_DENIED_ERROR
DELETE
FROM
v1
;
--
disconnect
user
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment