mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
When executing ALTER TABLE all the attributes of the view were overwritten. This is contrary to the user's expectations. So some of the view attributes are preserved now : namely security and algorithm. This means that if they are not specified in ALTER VIEW their values are preserved from CREATE VIEW instead of being defaulted. mysql-test/r/view.result: Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM - test suite mysql-test/t/view.test: Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM - test suite sql/sql_lex.h: Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM - must make create_view_suid a tristate : on/off/unspecified sql/sql_view.cc: Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM - open the view to get it's attributes and put then as defaults for ALTER VIEW sql/sql_yacc.yy: Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM - must make create_view_suid a tristate : on/off/unspecified sql/table.h: Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM - must make create_view_suid a tristate : on/off/unspecified
This commit is contained in:
@ -2807,3 +2807,14 @@ yadda
|
||||
yad
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (x INT, y INT);
|
||||
CREATE ALGORITHM=TEMPTABLE SQL SECURITY INVOKER VIEW v1 AS SELECT x FROM t1;
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select `t1`.`x` AS `x` from `t1`
|
||||
ALTER VIEW v1 AS SELECT x, y FROM t1;
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select `t1`.`x` AS `x`,`t1`.`y` AS `y` from `t1`
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
@ -2667,3 +2667,16 @@ SELECT * FROM v1;
|
||||
DROP VIEW v1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
#Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
|
||||
#
|
||||
CREATE TABLE t1 (x INT, y INT);
|
||||
CREATE ALGORITHM=TEMPTABLE SQL SECURITY INVOKER VIEW v1 AS SELECT x FROM t1;
|
||||
SHOW CREATE VIEW v1;
|
||||
|
||||
ALTER VIEW v1 AS SELECT x, y FROM t1;
|
||||
SHOW CREATE VIEW v1;
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user