Commit c5895a96 authored by anozdrin@mysql.com's avatar anozdrin@mysql.com

After-merge fixes.

parent c1ef46fc
...@@ -135,6 +135,7 @@ SET @new_sum = 0; ...@@ -135,6 +135,7 @@ SET @new_sum = 0;
Warnings: Warnings:
Note 1449 There is no 'mysqltest_nonexs'@'localhost' registered Note 1449 There is no 'mysqltest_nonexs'@'localhost' registered
INSERT INTO t1 VALUES(6); INSERT INTO t1 VALUES(6);
ERROR HY000: There is no 'mysqltest_nonexs'@'localhost' registered
SHOW TRIGGERS; SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer Trigger Event Table Statement Timing Created sql_mode Definer
trg1 INSERT t1 SET @new_sum = 0 BEFORE NULL mysqltest_inv@localhost trg1 INSERT t1 SET @new_sum = 0 BEFORE NULL mysqltest_inv@localhost
......
...@@ -522,11 +522,16 @@ use test; ...@@ -522,11 +522,16 @@ use test;
drop user mysqltest_1@localhost; drop user mysqltest_1@localhost;
drop database mysqltest; drop database mysqltest;
create definer=some_user@`` sql security invoker view v1 as select 1; create definer=some_user@`` sql security invoker view v1 as select 1;
ERROR HY000: Definer is not fully qualified Warnings:
create definer=some_user@localhost sql security invoker view v1 as select 1; Note 1449 There is no 'some_user'@'' registered
create definer=some_user@localhost sql security invoker view v2 as select 1;
Warnings: Warnings:
Note 1449 There is no 'some_user'@'localhost' registered Note 1449 There is no 'some_user'@'localhost' registered
show create view v1; show create view v1;
View Create View View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1` v1 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
show create view v2;
View Create View
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select 1 AS `1`
drop view v1; drop view v1;
drop view v2;
...@@ -317,10 +317,7 @@ CREATE DEFINER='mysqltest_nonexs'@'localhost' ...@@ -317,10 +317,7 @@ CREATE DEFINER='mysqltest_nonexs'@'localhost'
# Check that trg2 will not be activated. # Check that trg2 will not be activated.
# --error ER_SPECIFIC_ACCESS_DENIED_ERROR --error ER_NO_SUCH_USER
#
# TODO: Due to the BUG#13198(SP executes if definer does not exist) the
# following statement does not fail as it should.
INSERT INTO t1 VALUES(6); INSERT INTO t1 VALUES(6);
# #
......
...@@ -712,10 +712,11 @@ connection default; ...@@ -712,10 +712,11 @@ connection default;
# #
# DEFINER information check # DEFINER information check
# #
-- error ER_MALFORMED_DEFINER
create definer=some_user@`` sql security invoker view v1 as select 1; create definer=some_user@`` sql security invoker view v1 as select 1;
create definer=some_user@localhost sql security invoker view v1 as select 1; create definer=some_user@localhost sql security invoker view v2 as select 1;
show create view v1; show create view v1;
show create view v2;
drop view v1; drop view v1;
drop view v2;
...@@ -7475,8 +7475,7 @@ LEX_USER *create_default_definer(THD *thd) ...@@ -7475,8 +7475,7 @@ LEX_USER *create_default_definer(THD *thd)
/* /*
Create definer with the given user and host names. Also check that the user Create definer with the given user and host names.
and host names satisfy definers requirements.
SYNOPSIS SYNOPSIS
create_definer() create_definer()
...@@ -7494,14 +7493,6 @@ LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name) ...@@ -7494,14 +7493,6 @@ LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name)
{ {
LEX_USER *definer; LEX_USER *definer;
/* Check that specified host name is valid. */
if (host_name->length == 0)
{
my_error(ER_MALFORMED_DEFINER, MYF(0));
return 0;
}
/* Create and initialize. */ /* Create and initialize. */
if (! (definer= (LEX_USER*) thd->alloc(sizeof(LEX_USER)))) if (! (definer= (LEX_USER*) thd->alloc(sizeof(LEX_USER))))
......
...@@ -831,7 +831,7 @@ append_identifier(THD *thd, String *packet, const char *name, uint length) ...@@ -831,7 +831,7 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)
int get_quote_char_for_identifier(THD *thd, const char *name, uint length) int get_quote_char_for_identifier(THD *thd, const char *name, uint length)
{ {
if (!length || if (length &&
!is_keyword(name,length) && !is_keyword(name,length) &&
!require_quotes(name, length) && !require_quotes(name, length) &&
!(thd->options & OPTION_QUOTE_SHOW_CREATE)) !(thd->options & OPTION_QUOTE_SHOW_CREATE))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment