Fixed BUG#5258: Stored procedure modified date is 0000-00-00.
Althought techically not a but (as it's functioning as designed), it was decided that the design should be changed. Some users have a problem with dates being '0000-00-00' and the SQL standard specifies that the modification date should be the same as the creation date at creation. mysql-test/r/sp.result: New test case for BUG#5258. mysql-test/t/sp.test: New test case for BUG#5258. sql/sp.cc: Set the modification time at creation too.
This commit is contained in:
parent
9243aa9ebe
commit
1bf3ce01c4
@ -1784,6 +1784,24 @@ select @x|
|
||||
@x
|
||||
3
|
||||
drop procedure bug5307|
|
||||
create procedure bug5258()
|
||||
begin
|
||||
end|
|
||||
create procedure bug5258_aux()
|
||||
begin
|
||||
declare c, m char(19);
|
||||
select created,modified into c,m from mysql.proc where name = 'bug5258';
|
||||
if c = m then
|
||||
select 'Ok';
|
||||
else
|
||||
select c, m;
|
||||
end if;
|
||||
end|
|
||||
call bug5258_aux()|
|
||||
Ok
|
||||
Ok
|
||||
drop procedure bug5258|
|
||||
drop procedure bug5258_aux|
|
||||
drop table if exists fac|
|
||||
create table fac (n int unsigned not null primary key, f bigint unsigned)|
|
||||
create procedure ifac(n int unsigned)
|
||||
|
@ -1953,6 +1953,30 @@ call bug5307()|
|
||||
select @x|
|
||||
drop procedure bug5307|
|
||||
|
||||
#
|
||||
# BUG#5258: Stored procedure modified date is 0000-00-00
|
||||
# (This was a design flaw)
|
||||
create procedure bug5258()
|
||||
begin
|
||||
end|
|
||||
|
||||
create procedure bug5258_aux()
|
||||
begin
|
||||
declare c, m char(19);
|
||||
|
||||
select created,modified into c,m from mysql.proc where name = 'bug5258';
|
||||
if c = m then
|
||||
select 'Ok';
|
||||
else
|
||||
select c, m;
|
||||
end if;
|
||||
end|
|
||||
|
||||
call bug5258_aux()|
|
||||
|
||||
drop procedure bug5258|
|
||||
drop procedure bug5258_aux|
|
||||
|
||||
|
||||
#
|
||||
# Some "real" examples
|
||||
|
@ -371,6 +371,7 @@ db_create_routine(THD *thd, int type, sp_head *sp)
|
||||
table->field[MYSQL_PROC_FIELD_DEFINER]->
|
||||
store(definer, (uint)strlen(definer), system_charset_info);
|
||||
((Field_timestamp *)table->field[MYSQL_PROC_FIELD_CREATED])->set_time();
|
||||
((Field_timestamp *)table->field[MYSQL_PROC_FIELD_MODIFIED])->set_time();
|
||||
table->field[MYSQL_PROC_FIELD_SQL_MODE]->
|
||||
store((longlong)thd->variables.sql_mode);
|
||||
if (sp->m_chistics->comment.str)
|
||||
|
Loading…
x
Reference in New Issue
Block a user