mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user