mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
fixed time_format printing (BUG#7521)
mysql-test/r/view.result: using time_format in view (BUG#7521) mysql-test/t/view.test: using time_format in view (BUG#7521) sql/item_timefunc.h: fixed func_name reportion
This commit is contained in:
@ -1743,3 +1743,8 @@ select * from v1;
|
|||||||
cast(1 as decimal)
|
cast(1 as decimal)
|
||||||
1.00
|
1.00
|
||||||
drop view v1;
|
drop view v1;
|
||||||
|
create view v1 as SELECT TIME_FORMAT(SEC_TO_TIME(3600),'%H:%i') as t;
|
||||||
|
select * from v1;
|
||||||
|
t
|
||||||
|
01:00
|
||||||
|
drop view v1;
|
||||||
|
@ -1587,3 +1587,10 @@ drop table t1;
|
|||||||
create view v1 as select cast(1 as decimal);
|
create view v1 as select cast(1 as decimal);
|
||||||
select * from v1;
|
select * from v1;
|
||||||
drop view v1;
|
drop view v1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# using time_format in view (BUG#7521)
|
||||||
|
#
|
||||||
|
create view v1 as SELECT TIME_FORMAT(SEC_TO_TIME(3600),'%H:%i') as t;
|
||||||
|
select * from v1;
|
||||||
|
drop view v1;
|
||||||
|
@ -503,7 +503,8 @@ public:
|
|||||||
Item_func_date_format(Item *a,Item *b,bool is_time_format_arg)
|
Item_func_date_format(Item *a,Item *b,bool is_time_format_arg)
|
||||||
:Item_str_func(a,b),is_time_format(is_time_format_arg) {}
|
:Item_str_func(a,b),is_time_format(is_time_format_arg) {}
|
||||||
String *val_str(String *str);
|
String *val_str(String *str);
|
||||||
const char *func_name() const { return "date_format"; }
|
const char *func_name() const
|
||||||
|
{ return is_time_format ? "time_format" : "date_format"; }
|
||||||
void fix_length_and_dec();
|
void fix_length_and_dec();
|
||||||
uint format_length(const String *format);
|
uint format_length(const String *format);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user