Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
91a7fbc8
Commit
91a7fbc8
authored
Oct 10, 2007
by
gluh@mysql.com/eagle.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#25359 Test 'view' is dependent on current year to be 2006
removed now() call to make the test to be year independent
parent
8e2a56ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
+15
-13
mysql-test/r/view.result
mysql-test/r/view.result
+8
-7
mysql-test/t/view.test
mysql-test/t/view.test
+7
-6
No files found.
mysql-test/r/view.result
View file @
91a7fbc8
...
...
@@ -2706,18 +2706,19 @@ CREATE TABLE t1(
fName varchar(25) NOT NULL,
lName varchar(25) NOT NULL,
DOB date NOT NULL,
test_date date NOT NULL,
uID int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t1(fName, lName, DOB) VALUES
('Hank', 'Hill', '1964-09-29'),
('Tom', 'Adams', '1908-02-14'),
('Homer', 'Simpson', '1968-03-05');
INSERT INTO t1(fName, lName, DOB
, test_date
) VALUES
('Hank', 'Hill', '1964-09-29'
, '2007-01-01'
),
('Tom', 'Adams', '1908-02-14'
, '2007-01-01'
),
('Homer', 'Simpson', '1968-03-05'
, '2007-01-01'
);
CREATE VIEW v1 AS
SELECT (year(
now()
)-year(DOB)) AS Age
SELECT (year(
test_date
)-year(DOB)) AS Age
FROM t1 HAVING Age < 75;
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` having (`Age` < 75)
SELECT (year(
now()
)-year(DOB)) AS Age FROM t1 HAVING Age < 75;
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(
`t1`.`test_date`
) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75)
SELECT (year(
test_date
)-year(DOB)) AS Age FROM t1 HAVING Age < 75;
Age
43
39
...
...
mysql-test/t/view.test
View file @
91a7fbc8
...
...
@@ -2548,19 +2548,20 @@ CREATE TABLE t1(
fName
varchar
(
25
)
NOT
NULL
,
lName
varchar
(
25
)
NOT
NULL
,
DOB
date
NOT
NULL
,
test_date
date
NOT
NULL
,
uID
int
unsigned
NOT
NULL
AUTO_INCREMENT
PRIMARY
KEY
);
INSERT
INTO
t1
(
fName
,
lName
,
DOB
)
VALUES
(
'Hank'
,
'Hill'
,
'1964-09-29'
),
(
'Tom'
,
'Adams'
,
'1908-02-14'
),
(
'Homer'
,
'Simpson'
,
'1968-03-05'
);
INSERT
INTO
t1
(
fName
,
lName
,
DOB
,
test_date
)
VALUES
(
'Hank'
,
'Hill'
,
'1964-09-29'
,
'2007-01-01'
),
(
'Tom'
,
'Adams'
,
'1908-02-14'
,
'2007-01-01'
),
(
'Homer'
,
'Simpson'
,
'1968-03-05'
,
'2007-01-01'
);
CREATE
VIEW
v1
AS
SELECT
(
year
(
now
()
)
-
year
(
DOB
))
AS
Age
SELECT
(
year
(
test_date
)
-
year
(
DOB
))
AS
Age
FROM
t1
HAVING
Age
<
75
;
SHOW
CREATE
VIEW
v1
;
SELECT
(
year
(
now
()
)
-
year
(
DOB
))
AS
Age
FROM
t1
HAVING
Age
<
75
;
SELECT
(
year
(
test_date
)
-
year
(
DOB
))
AS
Age
FROM
t1
HAVING
Age
<
75
;
SELECT
*
FROM
v1
;
DROP
VIEW
v1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment