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
0a76ad5f
Commit
0a76ad5f
authored
Feb 04, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-9175 Query parser tansforms MICROSECOND into SECOND_FRAC, which does not work
parent
a90da6e0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
mysql-test/r/second_frac-9175.result
mysql-test/r/second_frac-9175.result
+13
-0
mysql-test/t/second_frac-9175.test
mysql-test/t/second_frac-9175.test
+9
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+1
-1
No files found.
mysql-test/r/second_frac-9175.result
0 → 100644
View file @
0a76ad5f
select timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456');
timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456')
31622400123456
explain extended select timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456');
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
Warnings:
Note 1003 select timestampdiff(MICROSECOND,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456') AS `timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456')`
create view v1 as select timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456');
select * from v1;
Name_exp_1
31622400123456
drop view v1;
mysql-test/t/second_frac-9175.test
0 → 100644
View file @
0a76ad5f
#
# MDEV-9175 Query parser tansforms MICROSECOND into SECOND_FRAC, which does not work
#
select
timestampdiff
(
microsecond
,
'2000-01-01 00:00:00'
,
'2001-01-01 00:00:00.123456'
);
explain
extended
select
timestampdiff
(
microsecond
,
'2000-01-01 00:00:00'
,
'2001-01-01 00:00:00.123456'
);
create
view
v1
as
select
timestampdiff
(
microsecond
,
'2000-01-01 00:00:00'
,
'2001-01-01 00:00:00.123456'
);
select
*
from
v1
;
drop
view
v1
;
sql/item_timefunc.cc
View file @
0a76ad5f
...
...
@@ -2916,7 +2916,7 @@ void Item_func_timestamp_diff::print(String *str, enum_query_type query_type)
str
->
append
(
STRING_WITH_LEN
(
"SECOND"
));
break
;
case
INTERVAL_MICROSECOND
:
str
->
append
(
STRING_WITH_LEN
(
"
SECOND_FRAC
"
));
str
->
append
(
STRING_WITH_LEN
(
"
MICROSECOND
"
));
break
;
default:
break
;
...
...
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