mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Fix bug #12298 Typo in timestampdiff() function name results in erroneous
view being created. Item_func_timestamp_diff::func_name() were returning function name as "timestamp_diff" thus when view was executed function parameters wasn't properly recognized and error was raised.
This commit is contained in:
parent
8f115aafd7
commit
0f9b982970
4 changed files with 13 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue