Use relative dates so that the tests don't fail when the year

changes.
parent b54f20f8
...@@ -2675,9 +2675,9 @@ lName varchar(25) NOT NULL, ...@@ -2675,9 +2675,9 @@ lName varchar(25) NOT NULL,
DOB date NOT NULL, DOB date NOT NULL,
uID int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY); uID int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t1(fName, lName, DOB) VALUES INSERT INTO t1(fName, lName, DOB) VALUES
('Hank', 'Hill', '1964-09-29'), ('Alice', 'Hill', date_sub(curdate(), interval 15271 day)),
('Tom', 'Adams', '1908-02-14'), ('Bob', 'Adams', date_sub(curdate(), interval 33600 day)),
('Homer', 'Simpson', '1968-03-05'); ('Carol', 'Simpson', date_sub(curdate(), interval 13700 day));
CREATE VIEW v1 AS CREATE VIEW v1 AS
SELECT (year(now())-year(DOB)) AS Age SELECT (year(now())-year(DOB)) AS Age
FROM t1 HAVING Age < 75; FROM t1 HAVING Age < 75;
......
...@@ -2544,9 +2544,9 @@ CREATE TABLE t1( ...@@ -2544,9 +2544,9 @@ CREATE TABLE t1(
uID int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY); uID int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t1(fName, lName, DOB) VALUES INSERT INTO t1(fName, lName, DOB) VALUES
('Hank', 'Hill', '1964-09-29'), ('Alice', 'Hill', date_sub(curdate(), interval 15271 day)),
('Tom', 'Adams', '1908-02-14'), ('Bob', 'Adams', date_sub(curdate(), interval 33600 day)),
('Homer', 'Simpson', '1968-03-05'); ('Carol', 'Simpson', date_sub(curdate(), interval 13700 day));
CREATE VIEW v1 AS CREATE VIEW v1 AS
SELECT (year(now())-year(DOB)) AS Age SELECT (year(now())-year(DOB)) AS Age
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment