diff options
author | unknown <evgen@moonbone.local> | 2006-08-15 21:02:55 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2006-08-15 21:02:55 +0400 |
commit | c2ef98ad4c81a84bba7f36405f5d6f2384213aa9 (patch) | |
tree | c98c3c3173a3f84b33e283f6b4d1f13f84ba7bb6 /mysql-test/t/view.test | |
parent | 22485f4a5923c08c62a23b8f09770a90164dedae (diff) | |
download | mariadb-git-c2ef98ad4c81a84bba7f36405f5d6f2384213aa9.tar.gz |
Fixed bug#15950: NOW() optimized away in VIEWs
This bug is a side-effect of bug fix #16377. NOW() is optimized in
BETWEEN to integer constants to speed up query execution. When view is being
created it saves already modified query and thus becomes wrong.
The agg_cmp_type() function now substitutes constant result DATE/TIME functions
for their results only if the current query isn't CREATE VIEW or SHOW CREATE
VIEW.
mysql-test/t/view.test:
Added a test case for bug#15950: NOW() optimized away in VIEWs
mysql-test/r/view.result:
Added a test case for bug#15950: NOW() optimized away in VIEWs
sql/item_cmpfunc.cc:
Fixed bug#15950: NOW() optimized away in VIEWs
The agg_cmp_type() function now substitutes constant result DATE/TIME functions
for their results only if the current query isn't CREATE VIEW or SHOW CREATE
VIEW.
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r-- | mysql-test/t/view.test | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 5cb85ca6c9b..315a61f2003 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2718,3 +2718,12 @@ DROP TABLE t1; --disable_warnings DROP VIEW IF EXISTS v1; --enable_warnings + +# +# Bug #15950: NOW() optimized away in VIEWs +# +create table t1 (f1 datetime); +create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute; +show create view v1; +drop view v1; +drop table t1; |