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
6c980cfe
Commit
6c980cfe
authored
May 31, 2011
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return commented out tests.
parent
02a4c6e8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
62 deletions
+80
-62
mysql-test/r/view.result
mysql-test/r/view.result
+22
-0
mysql-test/r/view_grant.result
mysql-test/r/view_grant.result
+20
-15
mysql-test/t/view.test
mysql-test/t/view.test
+33
-36
mysql-test/t/view_grant.test
mysql-test/t/view_grant.test
+5
-11
No files found.
mysql-test/r/view.result
View file @
6c980cfe
...
@@ -2881,6 +2881,28 @@ Tables_in_test
...
@@ -2881,6 +2881,28 @@ Tables_in_test
t1
t1
DROP TABLE t1;
DROP TABLE t1;
DROP VIEW IF EXISTS v1;
DROP VIEW IF EXISTS v1;
CREATE DATABASE bug21261DB;
USE bug21261DB;
CREATE TABLE t1 (x INT);
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT x FROM t1;
GRANT INSERT, UPDATE ON v1 TO 'user21261'@'localhost';
GRANT INSERT, UPDATE ON t1 TO 'user21261'@'localhost';
CREATE TABLE t2 (y INT);
GRANT SELECT ON t2 TO 'user21261'@'localhost';
INSERT INTO v1 (x) VALUES (5);
UPDATE v1 SET x=1;
GRANT SELECT ON v1 TO 'user21261'@'localhost';
GRANT SELECT ON t1 TO 'user21261'@'localhost';
UPDATE v1,t2 SET x=1 WHERE x=y;
SELECT * FROM t1;
x
1
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user21261'@'localhost';
DROP USER 'user21261'@'localhost';
DROP VIEW v1;
DROP TABLE t1;
DROP DATABASE bug21261DB;
USE test;
create table t1 (f1 datetime);
create table t1 (f1 datetime);
create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute;
create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute;
show create view v1;
show create view v1;
...
...
mysql-test/r/view_grant.result
View file @
6c980cfe
...
@@ -172,29 +172,30 @@ a b
...
@@ -172,29 +172,30 @@ a b
35 4
35 4
46 5
46 5
50 10
50 10
update v1 set a=a+c;
select * from t1;
select * from t1;
a b
a b
1
3
2
1
6
2
2
4
3
2
8
3
35
4
40
4
46
5
52
5
50
10
61
10
update t2,v2 set v2.a=v2.a+v2.c where t2.x=v2.c;
update t2,v2 set v2.a=v2.a+v2.c where t2.x=v2.c;
select * from t1;
select * from t1;
a b
a b
1
3
2
1
6
2
27
3
31
3
39
4
44
4
5
1
5
5
7
5
50
10
61
10
update v2 set a=a+c;
update v2 set a=a+c;
select * from t1;
select * from t1;
a b
a b
1
5
2
1
8
2
3
0
3
3
4
3
4
3
4
4
8
4
56
5
62
5
60
10
71
10
update t2,v2 set v2.c=v2.a+v2.c where t2.x=v2.c;
update t2,v2 set v2.c=v2.a+v2.c where t2.x=v2.c;
ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for column 'c' in table 'v2'
ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for column 'c' in table 'v2'
update v2 set c=a+c;
update v2 set c=a+c;
...
@@ -575,12 +576,16 @@ UPDATE mysqltest1.v_ts SET x= 200 WHERE x = 100;
...
@@ -575,12 +576,16 @@ UPDATE mysqltest1.v_ts SET x= 200 WHERE x = 100;
ERROR 42000: UPDATE command denied to user 'readonly'@'localhost' for table 'v_ts'
ERROR 42000: UPDATE command denied to user 'readonly'@'localhost' for table 'v_ts'
UPDATE mysqltest1.v_ts SET x= 200;
UPDATE mysqltest1.v_ts SET x= 200;
ERROR 42000: UPDATE command denied to user 'readonly'@'localhost' for table 'v_ts'
ERROR 42000: UPDATE command denied to user 'readonly'@'localhost' for table 'v_ts'
UPDATE mysqltest1.v_tu SET x= 200 WHERE x = 100;
UPDATE mysqltest1.v_tus SET x= 200 WHERE x = 100;
UPDATE mysqltest1.v_tu SET x= 200;
DELETE FROM mysqltest1.v_ts WHERE x= 200;
DELETE FROM mysqltest1.v_ts WHERE x= 200;
ERROR 42000: DELETE command denied to user 'readonly'@'localhost' for table 'v_ts'
ERROR 42000: DELETE command denied to user 'readonly'@'localhost' for table 'v_ts'
DELETE FROM mysqltest1.v_ts;
DELETE FROM mysqltest1.v_ts;
ERROR 42000: DELETE command denied to user 'readonly'@'localhost' for table 'v_ts'
ERROR 42000: DELETE command denied to user 'readonly'@'localhost' for table 'v_ts'
DELETE FROM mysqltest1.v_td WHERE x= 200;
DELETE FROM mysqltest1.v_td WHERE x= 200;
ERROR 42000: SELECT command denied to user 'readonly'@'localhost' for column 'x' in table 'v_td'
ERROR 42000: SELECT command denied to user 'readonly'@'localhost' for column 'x' in table 'v_td'
DELETE FROM mysqltest1.v_tds WHERE x= 200;
DELETE FROM mysqltest1.v_td;
DELETE FROM mysqltest1.v_td;
DROP VIEW mysqltest1.v_tds;
DROP VIEW mysqltest1.v_tds;
DROP VIEW mysqltest1.v_td;
DROP VIEW mysqltest1.v_td;
...
...
mysql-test/t/view.test
View file @
6c980cfe
...
@@ -2783,42 +2783,39 @@ DROP VIEW IF EXISTS v1;
...
@@ -2783,42 +2783,39 @@ DROP VIEW IF EXISTS v1;
# Bug#21261 Wrong access rights was required for an insert to a view
# Bug#21261 Wrong access rights was required for an insert to a view
#
#
# !!! This test case fails in ps-protocol due to a bug in the code of mwl106
CREATE
DATABASE
bug21261DB
;
# !!! Uncomment it when the bug is fixed
USE
bug21261DB
;
connect
(
root
,
localhost
,
root
,,
bug21261DB
);
# CREATE DATABASE bug21261DB;
connection
root
;
# USE bug21261DB;
# connect (root,localhost,root,,bug21261DB);
CREATE
TABLE
t1
(
x
INT
);
# connection root;
CREATE
SQL
SECURITY
INVOKER
VIEW
v1
AS
SELECT
x
FROM
t1
;
#
GRANT
INSERT
,
UPDATE
ON
v1
TO
'user21261'
@
'localhost'
;
# CREATE TABLE t1 (x INT);
GRANT
INSERT
,
UPDATE
ON
t1
TO
'user21261'
@
'localhost'
;
# CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT x FROM t1;
CREATE
TABLE
t2
(
y
INT
);
# GRANT INSERT, UPDATE ON v1 TO 'user21261'@'localhost';
GRANT
SELECT
ON
t2
TO
'user21261'
@
'localhost'
;
# GRANT INSERT, UPDATE ON t1 TO 'user21261'@'localhost';
# CREATE TABLE t2 (y INT);
connect
(
user21261
,
localhost
,
user21261
,,
bug21261DB
);
# GRANT SELECT ON t2 TO 'user21261'@'localhost';
connection
user21261
;
#
INSERT
INTO
v1
(
x
)
VALUES
(
5
);
# connect (user21261, localhost, user21261,, bug21261DB);
UPDATE
v1
SET
x
=
1
;
# connection user21261;
connection
root
;
# INSERT INTO v1 (x) VALUES (5);
GRANT
SELECT
ON
v1
TO
'user21261'
@
'localhost'
;
# UPDATE v1 SET x=1;
GRANT
SELECT
ON
t1
TO
'user21261'
@
'localhost'
;
# connection root;
connection
user21261
;
# GRANT SELECT ON v1 TO 'user21261'@'localhost';
UPDATE
v1
,
t2
SET
x
=
1
WHERE
x
=
y
;
# GRANT SELECT ON t1 TO 'user21261'@'localhost';
connection
root
;
# connection user21261;
SELECT
*
FROM
t1
;
# UPDATE v1,t2 SET x=1 WHERE x=y;
REVOKE
ALL
PRIVILEGES
,
GRANT
OPTION
FROM
'user21261'
@
'localhost'
;
# connection root;
DROP
USER
'user21261'
@
'localhost'
;
# SELECT * FROM t1;
DROP
VIEW
v1
;
# REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user21261'@'localhost';
DROP
TABLE
t1
;
# DROP USER 'user21261'@'localhost';
DROP
DATABASE
bug21261DB
;
# DROP VIEW v1;
# DROP TABLE t1;
connection
default
;
# DROP DATABASE bug21261DB;
USE
test
;
#
disconnect
root
;
# connection default;
disconnect
user21261
;
# USE test;
# disconnect root;
# disconnect user21261;
#
#
...
...
mysql-test/t/view_grant.test
View file @
6c980cfe
...
@@ -223,9 +223,7 @@ use mysqltest;
...
@@ -223,9 +223,7 @@ use mysqltest;
# update with rights on VIEW column
# update with rights on VIEW column
update
t2
,
v1
set
v1
.
a
=
v1
.
a
+
v1
.
c
where
t2
.
x
=
v1
.
c
;
update
t2
,
v1
set
v1
.
a
=
v1
.
a
+
v1
.
c
where
t2
.
x
=
v1
.
c
;
select
*
from
t1
;
select
*
from
t1
;
# !!! This query fails in ps-protocol due to a bug in the code of mwl106
update
v1
set
a
=
a
+
c
;
# !!! Uncomment it when the bug is fixed
# update v1 set a=a+c;
select
*
from
t1
;
select
*
from
t1
;
# update with rights on whole VIEW
# update with rights on whole VIEW
update
t2
,
v2
set
v2
.
a
=
v2
.
a
+
v2
.
c
where
t2
.
x
=
v2
.
c
;
update
t2
,
v2
set
v2
.
a
=
v2
.
a
+
v2
.
c
where
t2
.
x
=
v2
.
c
;
...
@@ -763,11 +761,9 @@ INSERT INTO mysqltest1.v_ti VALUES (100);
...
@@ -763,11 +761,9 @@ INSERT INTO mysqltest1.v_ti VALUES (100);
UPDATE
mysqltest1
.
v_ts
SET
x
=
200
WHERE
x
=
100
;
UPDATE
mysqltest1
.
v_ts
SET
x
=
200
WHERE
x
=
100
;
--
error
ER_TABLEACCESS_DENIED_ERROR
--
error
ER_TABLEACCESS_DENIED_ERROR
UPDATE
mysqltest1
.
v_ts
SET
x
=
200
;
UPDATE
mysqltest1
.
v_ts
SET
x
=
200
;
# !!! These queries fail in ps-protocol due to a bug in the code of mwl106
UPDATE
mysqltest1
.
v_tu
SET
x
=
200
WHERE
x
=
100
;
# !!! Uncomment it when the bug is fixed
UPDATE
mysqltest1
.
v_tus
SET
x
=
200
WHERE
x
=
100
;
# UPDATE mysqltest1.v_tu SET x= 200 WHERE x = 100;
UPDATE
mysqltest1
.
v_tu
SET
x
=
200
;
# UPDATE mysqltest1.v_tus SET x= 200 WHERE x = 100;
# UPDATE mysqltest1.v_tu SET x= 200;
--
error
ER_TABLEACCESS_DENIED_ERROR
--
error
ER_TABLEACCESS_DENIED_ERROR
DELETE
FROM
mysqltest1
.
v_ts
WHERE
x
=
200
;
DELETE
FROM
mysqltest1
.
v_ts
WHERE
x
=
200
;
...
@@ -775,9 +771,7 @@ DELETE FROM mysqltest1.v_ts WHERE x= 200;
...
@@ -775,9 +771,7 @@ DELETE FROM mysqltest1.v_ts WHERE x= 200;
DELETE
FROM
mysqltest1
.
v_ts
;
DELETE
FROM
mysqltest1
.
v_ts
;
--
error
ER_COLUMNACCESS_DENIED_ERROR
--
error
ER_COLUMNACCESS_DENIED_ERROR
DELETE
FROM
mysqltest1
.
v_td
WHERE
x
=
200
;
DELETE
FROM
mysqltest1
.
v_td
WHERE
x
=
200
;
# !!! These queries fail in ps-protocol due to a bug in the code of mwl106
DELETE
FROM
mysqltest1
.
v_tds
WHERE
x
=
200
;
# !!! Uncomment it when the bug is fixed
# DELETE FROM mysqltest1.v_tds WHERE x= 200;
DELETE
FROM
mysqltest1
.
v_td
;
DELETE
FROM
mysqltest1
.
v_td
;
connection
default
;
connection
default
;
...
...
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