diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 63da5589c57..28eb48790e0 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -687,7 +687,7 @@ timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12: id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select timestamp_diff(WEEK,_latin1'2001-02-01',_latin1'2001-05-01') AS `a1`,timestamp_diff(SECOND_FRAC,_latin1'2001-02-01 12:59:59.120000',_latin1'2001-05-01 12:58:58.119999') AS `a2` +Note 1003 select timestampdiff(WEEK,_latin1'2001-02-01',_latin1'2001-05-01') AS `a1`,timestampdiff(SECOND_FRAC,_latin1'2001-02-01 12:59:59.120000',_latin1'2001-05-01 12:58:58.119999') AS `a2` select last_day('2005-00-00'); last_day('2005-00-00') NULL diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 87e80a03c08..2af2f06ad52 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2092,3 +2092,8 @@ SELECT a FROM v1; a DROP VIEW v1; DROP TABLE t1,t2,t3,t4,t5; +create view v1 as select timestampdiff(day,'1997-01-01 00:00:00','1997-01-02 00:00:00') as f1; +select * from v1; +f1 +1 +drop view v1; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 961b8ec13d6..ceff7af401c 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -1936,4 +1936,9 @@ SELECT a FROM v1; DROP VIEW v1; DROP TABLE t1,t2,t3,t4,t5; - +# +# Bug #12298 Typo in function name results in erroneous view being created. +# +create view v1 as select timestampdiff(day,'1997-01-01 00:00:00','1997-01-02 00:00:00') as f1; +select * from v1; +drop view v1; diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index e79bc25030b..d9300451fe7 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -860,7 +860,7 @@ class Item_func_timestamp_diff :public Item_int_func public: Item_func_timestamp_diff(Item *a,Item *b,interval_type type_arg) :Item_int_func(a,b), int_type(type_arg) {} - const char *func_name() const { return "timestamp_diff"; } + const char *func_name() const { return "timestampdiff"; } longlong val_int(); void fix_length_and_dec() {