Fixed BUG#14719: Views DEFINER grammar is incorrect

Corrected the syntax for the current_user() case.
  (It's "definer = current_user[()]", not just "current_user[()]".)
This commit is contained in:
pem@mysql.com 2005-11-09 16:51:00 +01:00
parent c669c38769
commit b01e7393bf
3 changed files with 24 additions and 1 deletions

View File

@ -2375,3 +2375,13 @@ Warnings:
Error 1146 Table 'test.t1' doesn't exist
Error 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
DROP VIEW v1;
create definer = current_user() sql security invoker view v1 as select 1;
show create view v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
drop view v1;
create definer = current_user sql security invoker view v1 as select 1;
show create view v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
drop view v1;

View File

@ -2240,3 +2240,16 @@ DROP TABLE t1;
OPTIMIZE TABLE v1;
DROP VIEW v1;
#
# BUG#14719: Views DEFINER grammar is incorrect
#
create definer = current_user() sql security invoker view v1 as select 1;
show create view v1;
drop view v1;
create definer = current_user sql security invoker view v1 as select 1;
show create view v1;
drop view v1;

View File

@ -9008,7 +9008,7 @@ view_user:
thd->lex->create_view_definer))
YYABORT;
}
| CURRENT_USER optional_braces
| DEFINER_SYM EQ CURRENT_USER optional_braces
{
THD *thd= YYTHD;
if (!(thd->lex->create_view_definer=