Commit fe0b818f authored by unknown's avatar unknown
Browse files

After-merge fixes.


mysql-test/r/trigger-grant.result:
  Updated the result file.
mysql-test/r/view_grant.result:
  Updated the result file.
mysql-test/t/trigger-grant.test:
  A patch for BUG#13198 has been merged, so need to update the test case.
mysql-test/t/view_grant.test:
  A patch for BUG#16777 has been merged, so need to update the test case.
sql/sql_parse.cc:
  After-merge fix (should have been a part of fix for BUG#16777).
sql/sql_show.cc:
  After-merge fix -- empty identifier should be quoted.
parent 99b9f7a4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -135,6 +135,7 @@ SET @new_sum = 0;
Warnings:
Note	1449	There is no 'mysqltest_nonexs'@'localhost' registered
INSERT INTO t1 VALUES(6);
ERROR HY000: There is no 'mysqltest_nonexs'@'localhost' registered
SHOW TRIGGERS;
Trigger	Event	Table	Statement	Timing	Created	sql_mode	Definer
trg1	INSERT	t1	SET @new_sum = 0	BEFORE	NULL		mysqltest_inv@localhost
+8 −3
Original line number Diff line number Diff line
@@ -522,11 +522,16 @@ use test;
drop user mysqltest_1@localhost;
drop database mysqltest;
create definer=some_user@`` sql security invoker view v1 as select 1;
ERROR HY000: Definer is not fully qualified
create definer=some_user@localhost sql security invoker view v1 as select 1;
Warnings:
Note	1449	There is no 'some_user'@'' registered
create definer=some_user@localhost sql security invoker view v2 as select 1;
Warnings:
Note	1449	There is no 'some_user'@'localhost' registered
show create view v1;
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 v2;
+1 −4
Original line number Diff line number Diff line
@@ -317,10 +317,7 @@ CREATE DEFINER='mysqltest_nonexs'@'localhost'

# Check that trg2 will not be activated.

# --error ER_SPECIFIC_ACCESS_DENIED_ERROR
#
# TODO: Due to the BUG#13198(SP executes if definer does not exist) the
# following statement does not fail as it should.
--error ER_NO_SUCH_USER
INSERT INTO t1 VALUES(6);

#
+3 −2
Original line number Diff line number Diff line
@@ -712,10 +712,11 @@ connection default;
#
# DEFINER information check
#
-- error ER_MALFORMED_DEFINER
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 v2;
drop view v1;
drop view v2;

+1 −10
Original line number Diff line number Diff line
@@ -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
  and host names satisfy definers requirements.
  Create definer with the given user and host names.

  SYNOPSIS
    create_definer()
@@ -7494,14 +7493,6 @@ LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name)
{
  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. */

  if (! (definer= (LEX_USER*) thd->alloc(sizeof(LEX_USER))))
Loading