Bug #44996 | Now inside of a procedure should return time procedure was exectued | ||
---|---|---|---|
Submitted: | 20 May 2009 20:58 | Modified: | 22 May 2009 15:31 |
Reporter: | Thomas Johnson | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S2 (Serious) |
Version: | 5.0.36sp1-enterprise-gpl-nt-log | OS: | Windows (Server 2003) |
Assigned to: | Paul DuBois | CPU Architecture: | Any |
Tags: | now() procedure |
[20 May 2009 20:58]
Thomas Johnson
[22 May 2009 15:25]
Paul DuBois
The documentation is incorrect. The difference between SYSDATE() and NOW() is not for stored routines and triggers, it is for stored *functions* and triggers. That means there is no effect for stored *procedures*. Test program: use test; DELIMITER $$ DROP FUNCTION IF EXISTS `test`.`mytest` $$ CREATE FUNCTION `test`.`mytest` () RETURNS INT DETERMINISTIC BEGIN set @myTime1 = now(); set @myTime3 = sysdate(); set @iThrow = sleep(2); set @myTime2 = now(); set @myTime4 = sysdate(); return 1; END $$ DELIMITER ; select mytest(); select @myTime1, @myTime2, @myTime3, @myTime4\G Result: @myTime1: 2009-05-22 10:12:56 @myTime2: 2009-05-22 10:12:56 @myTime3: 2009-05-22 10:12:56 @myTime4: 2009-05-22 10:12:58
[22 May 2009 15:29]
MySQL Verification Team
Thank you for the bug report.
[22 May 2009 15:31]
Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.
[5 Jun 2009 18:05]
Paul DuBois
See also Bug#33832.