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
cfbd7148
Commit
cfbd7148
authored
Jun 20, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-19774 Assertion `sec.se c() <= 0x7FFFFFFFL' failed in Item_func_from_unixtime::get_date
parent
02979daa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
4 deletions
+47
-4
mysql-test/main/func_time.result
mysql-test/main/func_time.result
+6
-0
mysql-test/main/func_time.test
mysql-test/main/func_time.test
+7
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+3
-3
sql/sql_type.h
sql/sql_type.h
+31
-1
No files found.
mysql-test/main/func_time.result
View file @
cfbd7148
...
...
@@ -6345,3 +6345,9 @@ NULL
SELECT CONCAT(MAKETIME('01', '01', LEAST( -100, NULL )));
CONCAT(MAKETIME('01', '01', LEAST( -100, NULL )))
NULL
#
# MDEV-19774 Assertion `sec.se c() <= 0x7FFFFFFFL' failed in Item_func_from_unixtime::get_date
#
SELECT FROM_UNIXTIME(LEAST(3696610869, NULL));
FROM_UNIXTIME(LEAST(3696610869, NULL))
NULL
mysql-test/main/func_time.test
View file @
cfbd7148
...
...
@@ -3170,3 +3170,10 @@ SET time_zone=DEFAULT;
SELECT
MAKETIME
(
'01'
,
'01'
,
LEAST
(
-
100
,
NULL
));
SELECT
CONCAT
(
MAKETIME
(
'01'
,
'01'
,
LEAST
(
-
100
,
NULL
)));
--
echo
#
--
echo
# MDEV-19774 Assertion `sec.se c() <= 0x7FFFFFFFL' failed in Item_func_from_unixtime::get_date
--
echo
#
SELECT
FROM_UNIXTIME
(
LEAST
(
3696610869
,
NULL
));
sql/item_timefunc.cc
View file @
cfbd7148
...
...
@@ -1933,7 +1933,7 @@ bool Item_func_from_unixtime::get_date(THD *thd, MYSQL_TIME *ltime,
ltime
->
time_type
=
MYSQL_TIMESTAMP_TIME
;
VSec9
sec
(
thd
,
args
[
0
],
"unixtime"
,
TIMESTAMP_MAX_VALUE
);
DBUG_ASSERT
(
sec
.
sec
()
<=
TIMESTAMP_MAX_VALUE
);
DBUG_ASSERT
(
sec
.
is_null
()
||
sec
.
sec
()
<=
TIMESTAMP_MAX_VALUE
);
if
(
sec
.
is_null
()
||
sec
.
truncated
()
||
sec
.
neg
())
return
(
null_value
=
1
);
...
...
@@ -2601,8 +2601,8 @@ bool Item_func_maketime::get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzy
return
(
null_value
=
1
);
int
warn
;
new
(
ltime
)
Time
(
&
warn
,
hour
.
neg
(),
hour
.
abs
(),
(
uint
)
minute
,
sec
,
thd
->
temporal_round_mode
(),
decimals
);
new
(
ltime
)
Time
(
&
warn
,
hour
.
neg
(),
hour
.
abs
(),
(
uint
)
minute
,
sec
.
to_const_sec9
(),
thd
->
temporal_round_mode
(),
decimals
);
if
(
warn
)
{
// use check_time_range() to set ltime to the max value depending on dec
...
...
sql/sql_type.h
View file @
cfbd7148
...
...
@@ -499,12 +499,42 @@ class Sec9: public Sec6
};
class
VSec9
:
p
ublic
Sec9
class
VSec9
:
p
rotected
Sec9
{
bool
m_is_null
;
Sec9
&
to_sec9
()
{
DBUG_ASSERT
(
!
is_null
());
return
*
this
;
}
public:
VSec9
(
THD
*
thd
,
Item
*
item
,
const
char
*
type_str
,
ulonglong
limit
);
bool
is_null
()
const
{
return
m_is_null
;
}
const
Sec9
&
to_const_sec9
()
const
{
DBUG_ASSERT
(
!
is_null
());
return
*
this
;
}
bool
neg
()
const
{
return
to_const_sec9
().
neg
();
}
bool
truncated
()
const
{
return
to_const_sec9
().
truncated
();
}
ulonglong
sec
()
const
{
return
to_const_sec9
().
sec
();
}
long
usec
()
const
{
return
to_const_sec9
().
usec
();
}
bool
sec_to_time
(
MYSQL_TIME
*
ltime
,
uint
dec
)
const
{
return
to_const_sec9
().
sec_to_time
(
ltime
,
dec
);
}
void
make_truncated_warning
(
THD
*
thd
,
const
char
*
type_str
)
const
{
return
to_const_sec9
().
make_truncated_warning
(
thd
,
type_str
);
}
Sec9
&
round
(
uint
dec
)
{
return
to_sec9
().
round
(
dec
);
}
Sec9
&
round
(
uint
dec
,
time_round_mode_t
mode
)
{
return
to_sec9
().
round
(
dec
,
mode
);
}
};
...
...
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