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
456dd3af
Commit
456dd3af
authored
Dec 17, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/Users/kent/mysql/bk/mysql-4.1
parents
3fb8ba1d
3d6179e7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
6 deletions
+62
-6
mysql-test/r/type_time.result
mysql-test/r/type_time.result
+24
-0
mysql-test/t/type_time.test
mysql-test/t/type_time.test
+14
-0
sql-common/my_time.c
sql-common/my_time.c
+22
-6
zlib/Makefile.am
zlib/Makefile.am
+2
-0
No files found.
mysql-test/r/type_time.result
View file @
456dd3af
...
...
@@ -85,3 +85,27 @@ sec_to_time(time_to_sec(t))
13:00:00
09:00:00
drop table t1;
SELECT CAST(235959.123456 AS TIME);
CAST(235959.123456 AS TIME)
23:59:59.123456
SELECT CAST(0.235959123456e+6 AS TIME);
CAST(0.235959123456e+6 AS TIME)
23:59:59.123456
SELECT CAST(235959123456e-6 AS TIME);
CAST(235959123456e-6 AS TIME)
23:59:59.123456
SELECT CAST(235959.1234567 AS TIME);
CAST(235959.1234567 AS TIME)
23:59:59.123456
Warnings:
Warning 1292 Truncated incorrect time value: '235959.1234567'
SELECT CAST(0.2359591234567e6 AS TIME);
CAST(0.2359591234567e6 AS TIME)
23:59:59.123456
Warnings:
Warning 1292 Truncated incorrect time value: '235959.1234567'
SELECT CAST(0.2359591234567e+30 AS TIME);
CAST(0.2359591234567e+30 AS TIME)
NULL
Warnings:
Warning 1292 Truncated incorrect time value: '2.359591234567e+29'
mysql-test/t/type_time.test
View file @
456dd3af
...
...
@@ -21,4 +21,18 @@ select t, time_to_sec(t),sec_to_time(time_to_sec(t)) from t1;
select
sec_to_time
(
time_to_sec
(
t
))
from
t1
;
drop
table
t1
;
#
# BUG #12440: Incorrect processing of time values containing
# long fraction part and/or large exponent part.
#
# These must return normal result:
SELECT
CAST
(
235959.123456
AS
TIME
);
SELECT
CAST
(
0.235959123456e+6
AS
TIME
);
SELECT
CAST
(
235959123456
e
-
6
AS
TIME
);
# These must cut fraction part and produce warning:
SELECT
CAST
(
235959.1234567
AS
TIME
);
SELECT
CAST
(
0.2359591234567e6
AS
TIME
);
# This must return NULL and produce warning:
SELECT
CAST
(
0.2359591234567e+30
AS
TIME
);
# End of 4.1 tests
sql-common/my_time.c
View file @
456dd3af
...
...
@@ -514,18 +514,34 @@ bool str_to_time(const char *str, uint length, MYSQL_TIME *l_time,
/* Get fractional second part */
if
((
end
-
str
)
>=
2
&&
*
str
==
'.'
&&
my_isdigit
(
&
my_charset_latin1
,
str
[
1
]))
{
uint
field_length
=
5
;
int
field_length
=
5
;
str
++
;
value
=
(
uint
)
(
uchar
)
(
*
str
-
'0'
);
while
(
++
str
!=
end
&&
my_isdigit
(
&
my_charset_latin1
,
str
[
0
])
&&
field_length
--
)
value
=
value
*
10
+
(
uint
)
(
uchar
)
(
*
str
-
'0'
);
if
(
field_length
)
while
(
++
str
!=
end
&&
my_isdigit
(
&
my_charset_latin1
,
*
str
))
{
if
(
field_length
--
>
0
)
value
=
value
*
10
+
(
uint
)
(
uchar
)
(
*
str
-
'0'
);
}
if
(
field_length
>
0
)
value
*=
(
long
)
log_10_int
[
field_length
];
else
if
(
field_length
<
0
)
*
was_cut
=
1
;
date
[
4
]
=
value
;
}
else
date
[
4
]
=
0
;
/* Check for exponent part: E<gigit> | E<sign><digit> */
/* (may occur as result of %g formatting of time value) */
if
((
end
-
str
)
>
1
&&
(
*
str
==
'e'
||
*
str
==
'E'
)
&&
(
my_isdigit
(
&
my_charset_latin1
,
str
[
1
])
||
((
str
[
1
]
==
'-'
||
str
[
1
]
==
'+'
)
&&
(
end
-
str
)
>
2
&&
my_isdigit
(
&
my_charset_latin1
,
str
[
2
]))))
{
*
was_cut
=
1
;
return
1
;
}
if
(
internal_format_positions
[
7
]
!=
255
)
{
...
...
zlib/Makefile.am
View file @
456dd3af
...
...
@@ -18,6 +18,8 @@
pkglib_LTLIBRARIES
=
libz.la
libz_la_LDFLAGS
=
-version-info
3:3:2
noinst_HEADERS
=
crc32.h deflate.h inffast.h inffixed.h inflate.h
\
inftrees.h trees.h zconf.h zlib.h zutil.h
...
...
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