Bug #57155 Docs improvement request for SELECT NOW() being affected by SET TIMESTAMP
Submitted: 30 Sep 2010 23:10 Modified: 5 Jul 2011 16:49
Reporter: Roel Van de Paar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S4 (Feature request)
Version: OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[30 Sep 2010 23:10] Roel Van de Paar
Description:
"In addition, the SET TIMESTAMP statement affects the value returned by NOW() but not by SYSDATE(). This means that timestamp settings in the binary log have no effect on invocations of SYSDATE()."

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_now

Could we clarify this section?

What happens is that:

SET TIMESTAMP=1259819684;
SELECT NOW();
SELECT NOW();

Will keep returning the same time until you run:

SET TIMESTAMP=0;

How to repeat:
SET TIMESTAMP=1259819684;
SELECT NOW();
SELECT NOW();
[...]
SELECT NOW();
SET TIMESTAMP=0;
SELECT NOW();

Suggested fix:
The paragraph above hints at the issue but does not spell it out, it would be great if it did.
[30 Sep 2010 23:11] Roel Van de Paar
(http://forums.mysql.com/read.php?149,292500,294139#msg-294139)
[5 Jul 2011 16:49] 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.

Additional text:

Setting the timestamp to a nonzero value causes each subsequent
invocation of NOW() to return that value. Setting the timestamp to
zero cancels this effect so that NOW() once again returns the current
date and time.