~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/r/view_grant.result

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
779
779
GRANT DROP, CREATE VIEW ON db26813.v3 TO u26813@localhost;
780
780
GRANT SELECT ON db26813.t1 TO u26813@localhost;
781
781
ALTER VIEW v1 AS SELECT f2 FROM t1;
782
 
ERROR 42000: Access denied; you need the SUPER privilege for this operation
 
782
ERROR 42000: CREATE VIEW command denied to user 'u26813'@'localhost' for table 'v1'
783
783
ALTER VIEW v2 AS SELECT f2 FROM t1;
784
 
ERROR 42000: Access denied; you need the SUPER privilege for this operation
 
784
ERROR 42000: DROP command denied to user 'u26813'@'localhost' for table 'v2'
785
785
ALTER VIEW v3 AS SELECT f2 FROM t1;
786
786
ERROR 42000: Access denied; you need the SUPER privilege for this operation
787
787
SHOW CREATE VIEW v3;
947
947
Warning 1356    View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
948
948
DROP VIEW v1;
949
949
DROP TABLE t1;
 
950
CREATE USER mysqluser1@localhost;
 
951
CREATE DATABASE mysqltest1;
 
952
USE mysqltest1;
 
953
CREATE TABLE t1 ( a INT );
 
954
CREATE TABLE t2 ( b INT );
 
955
INSERT INTO t1 VALUES (1), (2);
 
956
INSERT INTO t2 VALUES (1), (2);
 
957
GRANT CREATE VIEW ON mysqltest1.* TO mysqluser1@localhost;
 
958
GRANT SELECT ON t1 TO mysqluser1@localhost;
 
959
GRANT INSERT ON t2 TO mysqluser1@localhost;
 
960
This would lead to failed assertion.
 
961
CREATE VIEW v1 AS SELECT a, b FROM t1, t2;
 
962
SELECT * FROM v1;
 
963
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 'v1'
 
964
SELECT b FROM v1;
 
965
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 'v1'
 
966
DROP TABLE t1, t2;
 
967
DROP VIEW v1;
 
968
DROP DATABASE mysqltest1;
 
969
DROP USER mysqluser1@localhost;
 
970
USE test;
950
971
End of 5.1 tests.