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
db9c46de
Commit
db9c46de
authored
Mar 18, 2011
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
number to time comparison
parent
5ff5c4b8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
2 deletions
+28
-2
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+15
-0
mysql-test/t/func_time.test
mysql-test/t/func_time.test
+6
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+7
-2
No files found.
mysql-test/r/func_time.result
View file @
db9c46de
...
...
@@ -1358,6 +1358,21 @@ Warning 1292 Truncated incorrect time value: ''
Warning 1292 Truncated incorrect time value: ''
DROP TABLE t1;
End of 5.1 tests
select time('10:10:10') > 10;
time('10:10:10') > 10
1
select time('10:10:10') > 1010;
time('10:10:10') > 1010
1
select time('10:10:09') > 101010;
time('10:10:09') > 101010
0
select time('10:10:10') > 101010;
time('10:10:10') > 101010
0
select time('10:10:11') > 101010;
time('10:10:11') > 101010
1
select time(' 1 02:03:04') + interval 9 microsecond;
time(' 1 02:03:04') + interval 9 microsecond
26:03:04.000009
...
...
mysql-test/t/func_time.test
View file @
db9c46de
...
...
@@ -861,6 +861,12 @@ DROP TABLE t1;
--
echo
End
of
5.1
tests
select
time
(
'10:10:10'
)
>
10
;
select
time
(
'10:10:10'
)
>
1010
;
select
time
(
'10:10:09'
)
>
101010
;
select
time
(
'10:10:10'
)
>
101010
;
select
time
(
'10:10:11'
)
>
101010
;
select
time
(
' 1 02:03:04'
)
+
interval
9
microsecond
;
select
time
(
' 1 02:03:04'
)
-
interval
9
microsecond
;
select
time
(
'-1 02:03:04'
)
+
interval
9
microsecond
;
...
...
sql/item_cmpfunc.cc
View file @
db9c46de
...
...
@@ -870,9 +870,14 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
{
MYSQL_TIME
buf
;
int
was_cut
;
longlong
res
;
if
(
number_to_datetime
(
value
,
&
buf
,
TIME_INVALID_DATES
|
TIME_FUZZY_DATE
,
&
was_cut
)
==
-
1
)
if
(
t_type
==
MYSQL_TIMESTAMP_TIME
)
res
=
number_to_time
(
value
,
&
buf
,
&
was_cut
);
else
res
=
number_to_datetime
(
value
,
&
buf
,
TIME_INVALID_DATES
|
TIME_FUZZY_DATE
,
&
was_cut
);
if
(
res
==
-
1
)
{
const
Lazy_string_num
str
(
value
);
make_truncated_value_warning
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
...
...
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