Commit 2796e299 authored by pem@mysql.comhem.se's avatar pem@mysql.comhem.se

Don't want host in the definer's column.

parent 7a20e528
...@@ -918,7 +918,7 @@ n f ...@@ -918,7 +918,7 @@ n f
drop table fac; drop table fac;
show function status like '%f%'; show function status like '%f%';
Name Type Definer Modified Created Security_type Comment Name Type Definer Modified Created Security_type Comment
fac FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER fac FUNCTION root 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
drop procedure ifac; drop procedure ifac;
drop function fac; drop function fac;
show function status like '%f%'; show function status like '%f%';
...@@ -1011,8 +1011,8 @@ end loop; ...@@ -1011,8 +1011,8 @@ end loop;
end end
show procedure status like '%p%'; show procedure status like '%p%';
Name Type Definer Modified Created Security_type Comment Name Type Definer Modified Created Security_type Comment
ip PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER ip PROCEDURE root 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
opp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER opp PROCEDURE root 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
call ip(200); call ip(200);
select * from primes where i=45 or i=100 or i=199; select * from primes where i=45 or i=100 or i=199;
i p i p
...@@ -1074,7 +1074,7 @@ comment "111111111111" sql security invoker ...@@ -1074,7 +1074,7 @@ comment "111111111111" sql security invoker
insert into test.t1 values (x, y); insert into test.t1 values (x, y);
show procedure status like 'bar'; show procedure status like 'bar';
Name Type Definer Modified Created Security_type Comment Name Type Definer Modified Created Security_type Comment
bar PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER 111111111111 bar PROCEDURE root 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER 111111111111
alter procedure bar name bar2 comment "2222222222" sql security definer; alter procedure bar name bar2 comment "2222222222" sql security definer;
alter procedure bar2 name bar comment "3333333333"; alter procedure bar2 name bar comment "3333333333";
alter procedure bar; alter procedure bar;
...@@ -1085,7 +1085,7 @@ bar CREATE PROCEDURE bar(x char(16), y int) ...@@ -1085,7 +1085,7 @@ bar CREATE PROCEDURE bar(x char(16), y int)
insert into test.t1 values (x, y) insert into test.t1 values (x, y)
show procedure status like 'bar'; show procedure status like 'bar';
Name Type Definer Modified Created Security_type Comment Name Type Definer Modified Created Security_type Comment
bar PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER 3333333333 bar PROCEDURE root 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER 3333333333
drop procedure bar; drop procedure bar;
drop table t1; drop table t1;
drop table t2; drop table t2;
...@@ -265,7 +265,6 @@ db_create_routine(THD *thd, int type, sp_head *sp) ...@@ -265,7 +265,6 @@ db_create_routine(THD *thd, int type, sp_head *sp)
int ret; int ret;
TABLE *table; TABLE *table;
TABLE_LIST tables; TABLE_LIST tables;
char creator[HOSTNAME_LENGTH+USERNAME_LENGTH+2];
memset(&tables, 0, sizeof(tables)); memset(&tables, 0, sizeof(tables));
tables.db= (char*)"mysql"; tables.db= (char*)"mysql";
...@@ -276,7 +275,6 @@ db_create_routine(THD *thd, int type, sp_head *sp) ...@@ -276,7 +275,6 @@ db_create_routine(THD *thd, int type, sp_head *sp)
else else
{ {
restore_record(table, default_values); // Get default values for fields restore_record(table, default_values); // Get default values for fields
strxmov(creator, thd->user, "@", thd->host_or_ip, NullS);
if (table->fields != MYSQL_PROC_FIELD_COUNT) if (table->fields != MYSQL_PROC_FIELD_COUNT)
{ {
...@@ -302,7 +300,7 @@ db_create_routine(THD *thd, int type, sp_head *sp) ...@@ -302,7 +300,7 @@ db_create_routine(THD *thd, int type, sp_head *sp)
table->field[MYSQL_PROC_FIELD_BODY]-> table->field[MYSQL_PROC_FIELD_BODY]->
store(sp->m_body.str, sp->m_body.length, system_charset_info); store(sp->m_body.str, sp->m_body.length, system_charset_info);
table->field[MYSQL_PROC_FIELD_DEFINER]-> table->field[MYSQL_PROC_FIELD_DEFINER]->
store(creator, (uint)strlen(creator), system_charset_info); store(thd->user, (uint)strlen(thd->user), system_charset_info);
((Field_timestamp *)table->field[MYSQL_PROC_FIELD_CREATED])->set_time(); ((Field_timestamp *)table->field[MYSQL_PROC_FIELD_CREATED])->set_time();
table->field[MYSQL_PROC_FIELD_SQL_MODE]-> table->field[MYSQL_PROC_FIELD_SQL_MODE]->
store((longlong)thd->variables.sql_mode); store((longlong)thd->variables.sql_mode);
......
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