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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
54d0ec57
Commit
54d0ec57
authored
Jun 14, 2011
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for cast of negative numbers to datetime
parent
93a16a17
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
mysql-test/r/cast.result
mysql-test/r/cast.result
+1
-1
sql/time.cc
sql/time.cc
+2
-2
No files found.
mysql-test/r/cast.result
View file @
54d0ec57
...
...
@@ -329,7 +329,7 @@ cast(cast(1.1 as double) as datetime)
0000-00-00 00:00:01
select cast(cast(-1.1 as double) as datetime);
cast(cast(-1.1 as double) as datetime)
0000-00-00 00:00:01
NULL
explain extended select cast(10 as double(5,2));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
...
...
sql/time.cc
View file @
54d0ec57
...
...
@@ -271,10 +271,10 @@ static bool number_to_time_with_warn(bool neg, ulonglong nr, ulong sec_part,
else
{
f_type
=
MYSQL_TYPE_DATETIME
;
res
=
number_to_datetime
(
nr
,
sec_part
,
ltime
,
fuzzydate
,
&
was_cut
);
res
=
n
eg
?
-
1
:
n
umber_to_datetime
(
nr
,
sec_part
,
ltime
,
fuzzydate
,
&
was_cut
);
}
if
(
(
was_cut
&&
!
(
fuzzydate
&
TIME_FUZZY_DATE
))
||
res
<
0
)
if
(
res
<
0
||
(
was_cut
&&
!
(
fuzzydate
&
TIME_FUZZY_DATE
))
)
{
make_truncated_value_warning
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
str
,
...
...
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