mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
manual merge
mysql-test/r/view_grant.result: merged mysql-test/t/view_grant.test: merged
This commit is contained in:
@@ -618,6 +618,35 @@ ERROR HY000: There is no 'no-such-user'@'localhost' registered
|
|||||||
DROP VIEW v;
|
DROP VIEW v;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
USE test;
|
USE test;
|
||||||
|
CREATE USER mysqltest_db1@localhost identified by 'PWD';
|
||||||
|
GRANT ALL ON mysqltest_db1.* TO mysqltest_db1@localhost WITH GRANT OPTION;
|
||||||
|
CREATE SCHEMA mysqltest_db1 ;
|
||||||
|
USE mysqltest_db1 ;
|
||||||
|
CREATE TABLE t1 (f1 INTEGER);
|
||||||
|
CREATE VIEW view1 AS
|
||||||
|
SELECT * FROM t1;
|
||||||
|
SHOW CREATE VIEW view1;
|
||||||
|
View Create View
|
||||||
|
view1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_db1`@`localhost` SQL SECURITY DEFINER VIEW `view1` AS select `t1`.`f1` AS `f1` from `t1`
|
||||||
|
CREATE VIEW view2 AS
|
||||||
|
SELECT * FROM view1;
|
||||||
|
# Here comes a suspicious warning
|
||||||
|
SHOW CREATE VIEW view2;
|
||||||
|
View Create View
|
||||||
|
view2 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_db1`@`localhost` SQL SECURITY DEFINER VIEW `view2` AS select `view1`.`f1` AS `f1` from `view1`
|
||||||
|
# But the view view2 is usable
|
||||||
|
SELECT * FROM view2;
|
||||||
|
f1
|
||||||
|
CREATE VIEW view3 AS
|
||||||
|
SELECT * FROM view2;
|
||||||
|
SELECT * from view3;
|
||||||
|
f1
|
||||||
|
DROP VIEW mysqltest_db1.view3;
|
||||||
|
DROP VIEW mysqltest_db1.view2;
|
||||||
|
DROP VIEW mysqltest_db1.view1;
|
||||||
|
DROP TABLE mysqltest_db1.t1;
|
||||||
|
DROP SCHEMA mysqltest_db1;
|
||||||
|
DROP USER mysqltest_db1@localhost;
|
||||||
CREATE DATABASE test1;
|
CREATE DATABASE test1;
|
||||||
CREATE DATABASE test2;
|
CREATE DATABASE test2;
|
||||||
CREATE TABLE test1.t0 (a VARCHAR(20));
|
CREATE TABLE test1.t0 (a VARCHAR(20));
|
||||||
|
@@ -808,6 +808,44 @@ DROP VIEW v;
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
USE test;
|
USE test;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#20363: Create view on just created view is now denied
|
||||||
|
#
|
||||||
|
eval CREATE USER mysqltest_db1@localhost identified by 'PWD';
|
||||||
|
eval GRANT ALL ON mysqltest_db1.* TO mysqltest_db1@localhost WITH GRANT OPTION;
|
||||||
|
|
||||||
|
# The session with the non root user is needed.
|
||||||
|
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||||
|
connect (session1,localhost,mysqltest_db1,PWD,test);
|
||||||
|
|
||||||
|
CREATE SCHEMA mysqltest_db1 ;
|
||||||
|
USE mysqltest_db1 ;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (f1 INTEGER);
|
||||||
|
|
||||||
|
CREATE VIEW view1 AS
|
||||||
|
SELECT * FROM t1;
|
||||||
|
SHOW CREATE VIEW view1;
|
||||||
|
|
||||||
|
CREATE VIEW view2 AS
|
||||||
|
SELECT * FROM view1;
|
||||||
|
--echo # Here comes a suspicious warning
|
||||||
|
SHOW CREATE VIEW view2;
|
||||||
|
--echo # But the view view2 is usable
|
||||||
|
SELECT * FROM view2;
|
||||||
|
|
||||||
|
CREATE VIEW view3 AS
|
||||||
|
SELECT * FROM view2;
|
||||||
|
|
||||||
|
SELECT * from view3;
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
DROP VIEW mysqltest_db1.view3;
|
||||||
|
DROP VIEW mysqltest_db1.view2;
|
||||||
|
DROP VIEW mysqltest_db1.view1;
|
||||||
|
DROP TABLE mysqltest_db1.t1;
|
||||||
|
DROP SCHEMA mysqltest_db1;
|
||||||
|
DROP USER mysqltest_db1@localhost;
|
||||||
#
|
#
|
||||||
# BUG#20482: failure on Create join view with sources views/tables
|
# BUG#20482: failure on Create join view with sources views/tables
|
||||||
# in different schemas
|
# in different schemas
|
||||||
|
Reference in New Issue
Block a user