mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 11:27:39 +02:00
fix for double or decimal to datetime conversion
This commit is contained in:
parent
306ed65302
commit
34c9428871
3 changed files with 7 additions and 1 deletions
|
|
@ -87,6 +87,11 @@ Warning 1292 Truncated incorrect time value: '-3020399.9999999'
|
|||
select 20010101000203.000000004 + interval 1 day;
|
||||
20010101000203.000000004 + interval 1 day
|
||||
2001-01-02 00:02:03.000000
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect datetime value: '20010101000203.000000004'
|
||||
select 20010101000203.4 + interval 1 day;
|
||||
20010101000203.4 + interval 1 day
|
||||
2001-01-02 00:02:03.4
|
||||
set @a=cast('2011-01-02 12:13:14' as datetime);
|
||||
select @a + interval 1 minute;
|
||||
@a + interval 1 minute
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ drop table t1;
|
|||
select sec_to_time(3020399.99999), sec_to_time(3020399.999999), sec_to_time(3020399.9999999);
|
||||
select sec_to_time(-3020399.99999), sec_to_time(-3020399.999999), sec_to_time(-3020399.9999999);
|
||||
select 20010101000203.000000004 + interval 1 day;
|
||||
select 20010101000203.4 + interval 1 day;
|
||||
#
|
||||
# precision of expressions
|
||||
#
|
||||
|
|
|
|||
|
|
@ -984,7 +984,7 @@ bool Item::get_date(MYSQL_TIME *ltime,uint fuzzydate)
|
|||
{
|
||||
if (field_type() == MYSQL_TYPE_TIME)
|
||||
fuzzydate|= TIME_TIME_ONLY;
|
||||
if (result_type() == STRING_RESULT || fuzzydate & TIME_TIME_ONLY)
|
||||
if (result_type() != INT_RESULT || fuzzydate & TIME_TIME_ONLY)
|
||||
{
|
||||
char buff[40];
|
||||
String tmp(buff,sizeof(buff), &my_charset_bin),*res;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue