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
dcc35b66
Commit
dcc35b66
authored
Sep 25, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extract privilege tests from delete_returning.test into delete_returning_grant.test
that is not run for embedded server
parent
1989ae9e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
147 additions
and
135 deletions
+147
-135
mysql-test/r/delete_returning.result
mysql-test/r/delete_returning.result
+0
-66
mysql-test/r/delete_returning_grant.result
mysql-test/r/delete_returning_grant.result
+69
-0
mysql-test/t/delete_returning.test
mysql-test/t/delete_returning.test
+0
-69
mysql-test/t/delete_returning_grant.test
mysql-test/t/delete_returning_grant.test
+78
-0
No files found.
mysql-test/r/delete_returning.result
View file @
dcc35b66
...
...
@@ -167,72 +167,6 @@ a b
5 EEEEE
7 GGGGGGG
DEALLOCATE PREPARE stmt;
DELETE FROM t1;
INSERT INTO t1 SELECT * FROM t1c;
FLUSH PRIVILEGES;
CREATE DATABASE mysqltest;
CREATE TABLE mysqltest.t1 SELECT * FROM t1;
GRANT DELETE ON mysqltest.* TO mysqltest_1@localhost;
GRANT SELECT(b) ON mysqltest.t1 TO mysqltest_1@localhost;
DELETE FROM mysqltest.t1 WHERE a=2 RETURNING b;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'a' in table 't1'
DELETE FROM mysqltest.t1 RETURNING b;
b
ggggggg
a
ccc
dddd
A
BB
DDDD
EEEEE
GGGGGGG
bb
SELECT * FROM mysqltest.t1;
a b
INSERT INTO mysqltest.t1 SELECT * FROM t1;
GRANT SELECT(a) ON mysqltest.t1 TO mysqltest_1@localhost;
DELETE FROM mysqltest.t1 WHERE a=2 RETURNING b;
b
bb
BB
SELECT * FROM mysqltest.t1;
a b
7 GGGGGGG
5 EEEEE
4 DDDD
1 A
4 dddd
3 ccc
1 a
7 ggggggg
INSERT INTO mysqltest.t1 SELECT * FROM t1;
CREATE VIEW mysqltest.v1(a) AS SELECT a FROM mysqltest.t1;
GRANT SELECT, INSERT ON mysqltest.t1 TO mysqltest_1@localhost;
DELETE FROM mysqltest.v1;
SELECT * FROM mysqltest.t1;
a b
INSERT INTO mysqltest.t1 SELECT * FROM t1;
DELETE FROM mysqltest.v1 RETURNING a;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'a' in table 'v1'
GRANT SELECT ON mysqltest.* TO mysqltest_1@localhost;
DELETE FROM mysqltest.v1 RETURNING a;
a
7
1
3
4
1
2
4
5
7
2
SELECT * FROM mysqltest.t1;
a b
INSERT INTO mysqltest.t1 SELECT * FROM t1;
DROP DATABASE mysqltest;
DROP USER mysqltest_1@localhost;
DROP VIEW v1;
DROP TABLE t1,t2;
DROP TABLE t1c,t2c;
...
...
mysql-test/r/delete_returning_grant.result
0 → 100644
View file @
dcc35b66
CREATE TABLE t1 (a int(11), b varchar(32));
INSERT INTO t1 VALUES (7,'ggggggg'),(1,'a'),(3,'ccc'),(4,'dddd'),(1,'A'),
(2,'BB'),(4,'DDDD'),(5,'EEEEE'),(7,'GGGGGGG'),(2,'bb');
CREATE VIEW v1 AS SELECT a, UPPER(b) FROM t1;
CREATE DATABASE mysqltest;
CREATE TABLE mysqltest.t1 SELECT * FROM t1;
GRANT DELETE ON mysqltest.* TO mysqltest_1@localhost;
GRANT SELECT(b) ON mysqltest.t1 TO mysqltest_1@localhost;
DELETE FROM mysqltest.t1 WHERE a=2 RETURNING b;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'a' in table 't1'
DELETE FROM mysqltest.t1 RETURNING b;
b
ggggggg
a
ccc
dddd
A
BB
DDDD
EEEEE
GGGGGGG
bb
SELECT * FROM mysqltest.t1;
a b
INSERT INTO mysqltest.t1 SELECT * FROM t1;
GRANT SELECT(a) ON mysqltest.t1 TO mysqltest_1@localhost;
DELETE FROM mysqltest.t1 WHERE a=2 RETURNING b;
b
bb
BB
SELECT * FROM mysqltest.t1;
a b
7 GGGGGGG
5 EEEEE
4 DDDD
1 A
4 dddd
3 ccc
1 a
7 ggggggg
INSERT INTO mysqltest.t1 SELECT * FROM t1;
CREATE VIEW mysqltest.v1(a) AS SELECT a FROM mysqltest.t1;
GRANT SELECT, INSERT ON mysqltest.t1 TO mysqltest_1@localhost;
DELETE FROM mysqltest.v1;
SELECT * FROM mysqltest.t1;
a b
INSERT INTO mysqltest.t1 SELECT * FROM t1;
DELETE FROM mysqltest.v1 RETURNING a;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'a' in table 'v1'
GRANT SELECT ON mysqltest.* TO mysqltest_1@localhost;
DELETE FROM mysqltest.v1 RETURNING a;
a
7
1
3
4
1
2
4
5
7
2
SELECT * FROM mysqltest.t1;
a b
INSERT INTO mysqltest.t1 SELECT * FROM t1;
DROP DATABASE mysqltest;
DROP USER mysqltest_1@localhost;
DROP VIEW v1;
DROP TABLE t1;
mysql-test/t/delete_returning.test
View file @
dcc35b66
...
...
@@ -117,75 +117,6 @@ EXECUTE stmt;
SELECT
*
FROM
t1
;
DEALLOCATE
PREPARE
stmt
;
DELETE
FROM
t1
;
INSERT
INTO
t1
SELECT
*
FROM
t1c
;
# DELETE FROM <table> ... RETURNING ... with checking privileges
FLUSH
PRIVILEGES
;
connect
(
root
,
localhost
,
root
,,
test
);
connection
root
;
--
disable_warnings
CREATE
DATABASE
mysqltest
;
--
enable_warnings
CREATE
TABLE
mysqltest
.
t1
SELECT
*
FROM
t1
;
GRANT
DELETE
ON
mysqltest
.*
TO
mysqltest_1
@
localhost
;
GRANT
SELECT
(
b
)
ON
mysqltest
.
t1
TO
mysqltest_1
@
localhost
;
connect
(
user1
,
localhost
,
mysqltest_1
,,
test
);
connection
user1
;
--
error
ER_COLUMNACCESS_DENIED_ERROR
DELETE
FROM
mysqltest
.
t1
WHERE
a
=
2
RETURNING
b
;
DELETE
FROM
mysqltest
.
t1
RETURNING
b
;
connection
root
;
SELECT
*
FROM
mysqltest
.
t1
;
INSERT
INTO
mysqltest
.
t1
SELECT
*
FROM
t1
;
GRANT
SELECT
(
a
)
ON
mysqltest
.
t1
TO
mysqltest_1
@
localhost
;
DELETE
FROM
mysqltest
.
t1
WHERE
a
=
2
RETURNING
b
;
SELECT
*
FROM
mysqltest
.
t1
;
INSERT
INTO
mysqltest
.
t1
SELECT
*
FROM
t1
;
connection
root
;
CREATE
VIEW
mysqltest
.
v1
(
a
)
AS
SELECT
a
FROM
mysqltest
.
t1
;
GRANT
SELECT
,
INSERT
ON
mysqltest
.
t1
TO
mysqltest_1
@
localhost
;
connection
user1
;
DELETE
FROM
mysqltest
.
v1
;
SELECT
*
FROM
mysqltest
.
t1
;
INSERT
INTO
mysqltest
.
t1
SELECT
*
FROM
t1
;
--
error
ER_COLUMNACCESS_DENIED_ERROR
DELETE
FROM
mysqltest
.
v1
RETURNING
a
;
connection
root
;
GRANT
SELECT
ON
mysqltest
.*
TO
mysqltest_1
@
localhost
;
connection
user1
;
DELETE
FROM
mysqltest
.
v1
RETURNING
a
;
SELECT
*
FROM
mysqltest
.
t1
;
INSERT
INTO
mysqltest
.
t1
SELECT
*
FROM
t1
;
connection
root
;
--
disable_warnings
DROP
DATABASE
mysqltest
;
--
enable_warnings
disconnect
user1
;
DROP
USER
mysqltest_1
@
localhost
;
# Cleanup
DROP
VIEW
v1
;
DROP
TABLE
t1
,
t2
;
...
...
mysql-test/t/delete_returning_grant.test
0 → 100644
View file @
dcc35b66
#
# Tests for DELETE FROM <table> ... RETURNING <expr>,...
#
--
source
include
/
not_embedded
.
inc
CREATE
TABLE
t1
(
a
int
(
11
),
b
varchar
(
32
));
INSERT
INTO
t1
VALUES
(
7
,
'ggggggg'
),(
1
,
'a'
),(
3
,
'ccc'
),(
4
,
'dddd'
),(
1
,
'A'
),
(
2
,
'BB'
),(
4
,
'DDDD'
),(
5
,
'EEEEE'
),(
7
,
'GGGGGGG'
),(
2
,
'bb'
);
CREATE
VIEW
v1
AS
SELECT
a
,
UPPER
(
b
)
FROM
t1
;
# DELETE FROM <table> ... RETURNING ... with checking privileges
connect
(
root
,
localhost
,
root
,,
test
);
connection
root
;
--
disable_warnings
CREATE
DATABASE
mysqltest
;
--
enable_warnings
CREATE
TABLE
mysqltest
.
t1
SELECT
*
FROM
t1
;
GRANT
DELETE
ON
mysqltest
.*
TO
mysqltest_1
@
localhost
;
GRANT
SELECT
(
b
)
ON
mysqltest
.
t1
TO
mysqltest_1
@
localhost
;
connect
(
user1
,
localhost
,
mysqltest_1
,,
test
);
connection
user1
;
--
error
ER_COLUMNACCESS_DENIED_ERROR
DELETE
FROM
mysqltest
.
t1
WHERE
a
=
2
RETURNING
b
;
DELETE
FROM
mysqltest
.
t1
RETURNING
b
;
connection
root
;
SELECT
*
FROM
mysqltest
.
t1
;
INSERT
INTO
mysqltest
.
t1
SELECT
*
FROM
t1
;
GRANT
SELECT
(
a
)
ON
mysqltest
.
t1
TO
mysqltest_1
@
localhost
;
DELETE
FROM
mysqltest
.
t1
WHERE
a
=
2
RETURNING
b
;
SELECT
*
FROM
mysqltest
.
t1
;
INSERT
INTO
mysqltest
.
t1
SELECT
*
FROM
t1
;
connection
root
;
CREATE
VIEW
mysqltest
.
v1
(
a
)
AS
SELECT
a
FROM
mysqltest
.
t1
;
GRANT
SELECT
,
INSERT
ON
mysqltest
.
t1
TO
mysqltest_1
@
localhost
;
connection
user1
;
DELETE
FROM
mysqltest
.
v1
;
SELECT
*
FROM
mysqltest
.
t1
;
INSERT
INTO
mysqltest
.
t1
SELECT
*
FROM
t1
;
--
error
ER_COLUMNACCESS_DENIED_ERROR
DELETE
FROM
mysqltest
.
v1
RETURNING
a
;
connection
root
;
GRANT
SELECT
ON
mysqltest
.*
TO
mysqltest_1
@
localhost
;
connection
user1
;
DELETE
FROM
mysqltest
.
v1
RETURNING
a
;
SELECT
*
FROM
mysqltest
.
t1
;
INSERT
INTO
mysqltest
.
t1
SELECT
*
FROM
t1
;
connection
root
;
--
disable_warnings
DROP
DATABASE
mysqltest
;
--
enable_warnings
disconnect
user1
;
DROP
USER
mysqltest_1
@
localhost
;
# Cleanup
DROP
VIEW
v1
;
DROP
TABLE
t1
;
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