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
a169ede1
Commit
a169ede1
authored
Mar 17, 2011
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lp:736358 Unexpected increased timestamp resolution with UNION
partial fix
parent
3c6ff364
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
0 deletions
+36
-0
mysql-test/r/func_time_hires.result
mysql-test/r/func_time_hires.result
+18
-0
mysql-test/t/func_time_hires.test
mysql-test/t/func_time_hires.test
+16
-0
sql/item_timefunc.h
sql/item_timefunc.h
+2
-0
No files found.
mysql-test/r/func_time_hires.result
View file @
a169ede1
...
...
@@ -149,3 +149,21 @@ select * from t1;
a
2011-01-01 01:01:01.123456
drop table t1;
create table t1 (f1 timestamp(6));
insert into t1 values ('2002-07-15 21:00:00');
select time(f1) from t1;
time(f1)
21:00:00.000000
select time(f1) from t1 union all select time(f1) from t1;
time(f1)
21:00:00.000000
21:00:00.000000
alter table t1 modify f1 varchar(100);
select time(f1) from t1;
time(f1)
21:00:00
select time(f1) from t1 union all select time(f1) from t1;
time(f1)
21:00:00.000000
21:00:00.000000
drop table t1;
mysql-test/t/func_time_hires.test
View file @
a169ede1
...
...
@@ -78,3 +78,19 @@ insert t1 values (now(6));
select
*
from
t1
;
drop
table
t1
;
#
# lp:736358 Unexpected increased timestamp resolution with UNION
#
# timestamp(6) case is fixed:
create
table
t1
(
f1
timestamp
(
6
));
insert
into
t1
values
(
'2002-07-15 21:00:00'
);
select
time
(
f1
)
from
t1
;
select
time
(
f1
)
from
t1
union
all
select
time
(
f1
)
from
t1
;
#alter table t1 modify f1 timestamp;
#select time(f1) from t1;
#select time(f1) from t1 union all select time(f1) from t1;
# but the effect cannot be eliminated completely:
alter
table
t1
modify
f1
varchar
(
100
);
select
time
(
f1
)
from
t1
;
select
time
(
f1
)
from
t1
union
all
select
time
(
f1
)
from
t1
;
drop
table
t1
;
sql/item_timefunc.h
View file @
a169ede1
...
...
@@ -699,6 +699,8 @@ public:
collation
.
set
(
&
my_charset_bin
);
maybe_null
=
1
;
max_length
=
MAX_TIME_WIDTH
;
if
(
decimals
==
NOT_FIXED_DEC
)
decimals
=
args
[
0
]
->
decimals
;
if
(
decimals
&&
decimals
!=
NOT_FIXED_DEC
)
max_length
+=
min
(
decimals
,
MAX_SEC_PART_DIGITS
)
+
1
;
}
...
...
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