Bug #26745 test "view" fails because the tests results are hardcoded for year 2006
Submitted: 1 Mar 2007 10:45 Modified: 1 Mar 2007 11:35
Reporter: Spunk Meyer Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.0.33 OS:Any (any)
Assigned to: CPU Architecture:Any

[1 Mar 2007 10:45] Spunk Meyer
Description:
When running the test suite the "view" test fails with this error :

Errors are (from /home/xxx/src/mysql-5.0.33/mysql-test/var/log/mysqltest-time) :
mysqltest: Result content mismatch
(the last lines may be the most important ones)
Below are the diffs between actual and expected results:
-------------------------------------------------------
*** r/view.result       2007-01-09 16:09:33.000000000 +0300
--- r/view.reject       2007-03-01 13:12:50.000000000 +0300
***************
*** 2686,2697 ****
  v1    CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(now()) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75)
  SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75;
  Age
! 42
! 38
  SELECT * FROM v1;
  Age
! 42
! 38
  DROP VIEW v1;
  DROP TABLE t1;
  CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a char(6) DEFAULT 'xxx');
--- 2686,2697 ----
  v1    CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(now()) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75)
  SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75;
  Age
! 43
! 39
  SELECT * FROM v1;
  Age
! 43
! 39
  DROP VIEW v1;
  DROP TABLE t1;
  CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a char(6) DEFAULT 'xxx');
-------------------------------------------------------

The error occurs because the expected results in the r/view.result file are correct only if the year(now()) function returns 2006.

How to repeat:
Run the view test with your system clock set to any year but the year 2006.

Suggested fix:
Use 2006 instead of year(now())
[1 Mar 2007 10:55] Spunk Meyer
Sorry this bug is a duplicate of Bug #25359
[1 Mar 2007 11:35] Sveta Smirnova
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

Thank you for your interest in MySQL.

Duplicate of Bug #25359