Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
34c94288
Commit
34c94288
authored
May 26, 2011
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for double or decimal to datetime conversion
parent
306ed653
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
mysql-test/r/func_time_hires.result
mysql-test/r/func_time_hires.result
+5
-0
mysql-test/t/func_time_hires.test
mysql-test/t/func_time_hires.test
+1
-0
sql/item.cc
sql/item.cc
+1
-1
No files found.
mysql-test/r/func_time_hires.result
View file @
34c94288
...
...
@@ -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
...
...
mysql-test/t/func_time_hires.test
View file @
34c94288
...
...
@@ -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
#
...
...
sql/item.cc
View file @
34c94288
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment