Commit d4109279 authored by unknown's avatar unknown

Fixed BUG#5251: mysql changes creation time of a procedure/function when altering.


mysql-test/r/sp.result:
  New test case for BUG#5251.
mysql-test/t/sp.test:
  New test case for BUG#5251.
sql/sp.cc:
  Don't update the created timestamp when doing alter procedure/function.
parent fffa919f
......@@ -1744,6 +1744,17 @@ select @n|
2
delete from t1|
drop procedure bug3157|
create procedure bug5251()
begin
end|
select created into @c1 from mysql.proc
where db='test' and name='bug5251'|
alter procedure bug5251 comment 'foobar'|
select count(*) from mysql.proc
where db='test' and name='bug5251' and created = @c1|
count(*)
1
drop procedure bug5251|
drop table if exists fac|
create table fac (n int unsigned not null primary key, f bigint unsigned)|
create procedure ifac(n int unsigned)
......
......@@ -1898,6 +1898,22 @@ select @n|
delete from t1|
drop procedure bug3157|
#
# BUG#5251: mysql changes creation time of a procedure/function when altering
#
create procedure bug5251()
begin
end|
select created into @c1 from mysql.proc
where db='test' and name='bug5251'|
--sleep 2
alter procedure bug5251 comment 'foobar'|
select count(*) from mysql.proc
where db='test' and name='bug5251' and created = @c1|
drop procedure bug5251|
#
# Some "real" examples
......
......@@ -425,6 +425,7 @@ db_update_routine(THD *thd, int type, sp_name *name,
if (ret == SP_OK)
{
store_record(table,record[1]);
table->timestamp_on_update_now = 0; // Don't update create time now.
((Field_timestamp *)table->field[MYSQL_PROC_FIELD_MODIFIED])->set_time();
if (chistics->suid != IS_DEFAULT_SUID)
table->field[MYSQL_PROC_FIELD_SECURITY_TYPE]->store((longlong)chistics->suid);
......
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