Bug #26428 mysql-test t/view fails every year due to the usage of now()
Submitted: 15 Feb 2007 21:42 Modified: 16 Feb 2007 11:18
Reporter: Christian Hammers (Silver Quality Contributor) (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.0.32 OS:
Assigned to: CPU Architecture:Any

[15 Feb 2007 21:42] Christian Hammers
Description:
The test t/view fails as it uses now() to calculate values :)

SHOW CREATE VIEW v1;
View    Create View
v1      CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(now()) - year(`t1`.`DOB`)) AS `Age` from `t1` ha

SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75;
Age
43
39

The expected values here are 42 and 48. I guess it was written in 2006 *g*

Oh, and what do I see here? It has even been corrected in 5.0.34: by changing the year numbers and not by removing now()? *scratching head*

bye,

-christian-

How to repeat:
run test suite on January 1st :)

Suggested fix:
Avoid now() in regression tests.
[16 Feb 2007 10:45] Sveta Smirnova
Thank you for the report.

I can not repeat failure with current BK sources.
[16 Feb 2007 11:18] Sveta Smirnova
Duplicate of the "year" Bug #25359