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
7b33a6a1
Commit
7b33a6a1
authored
Mar 13, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-18876 Assertion `is_valid_time_slow()' failed in Time::valid_MYSQL_TIME_to_valid_value
parent
62bfb2fe
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
7 deletions
+68
-7
mysql-test/include/type_hrtime.inc
mysql-test/include/type_hrtime.inc
+6
-0
mysql-test/main/type_time.result
mysql-test/main/type_time.result
+23
-1
mysql-test/main/type_time.test
mysql-test/main/type_time.test
+17
-0
mysql-test/main/type_time_hires.result
mysql-test/main/type_time_hires.result
+7
-0
sql/item.cc
sql/item.cc
+14
-0
sql/item.h
sql/item.h
+1
-6
No files found.
mysql-test/include/type_hrtime.inc
View file @
7b33a6a1
...
@@ -55,6 +55,12 @@ select * from t1;
...
@@ -55,6 +55,12 @@ select * from t1;
delete
from
t1
where
a
<
20110101
;
delete
from
t1
where
a
<
20110101
;
select
*
from
t1
;
select
*
from
t1
;
if
(
$type
==
time
)
{
delete
from
t1
where
a
is
not
null
;
select
*
from
t1
;
}
#
#
# create ... select
# create ... select
#
#
...
...
mysql-test/main/type_time.result
View file @
7b33a6a1
...
@@ -188,7 +188,7 @@ create table t1(f1 time);
...
@@ -188,7 +188,7 @@ create table t1(f1 time);
insert into t1 values ('23:38:57');
insert into t1 values ('23:38:57');
select f1, f1 = '2010-10-11 23:38:57' from t1;
select f1, f1 = '2010-10-11 23:38:57' from t1;
f1 f1 = '2010-10-11 23:38:57'
f1 f1 = '2010-10-11 23:38:57'
23:38:57
0
23:38:57
1
drop table t1;
drop table t1;
#
#
# MDEV-4634 Crash in CONVERT_TZ
# MDEV-4634 Crash in CONVERT_TZ
...
@@ -2186,5 +2186,27 @@ Warnings:
...
@@ -2186,5 +2186,27 @@ Warnings:
Warning 1264 Out of range value for column 't' at row 1
Warning 1264 Out of range value for column 't' at row 1
DROP TABLE t1;
DROP TABLE t1;
#
#
# MDEV-18876 Assertion `is_valid_time_slow()' failed in Time::valid_MYSQL_TIME_to_valid_value
#
CREATE TABLE t1 (f INT);
INSERT INTO t1 VALUES (1),(2);
SELECT DISTINCT f FROM t1 ORDER BY 1 && ( '1972-11-06 16:58:58' BETWEEN CONVERT( 0, TIME ) AND '20:31:05' );
f
1
2
DROP TABLE t1;
CREATE OR REPLACE TABLE t1 (a VARCHAR(32));
INSERT INTO t1 VALUES ('1972-11-06 16:58:58');
SELECT * FROM t1 WHERE a < TIME'20:31:05';
a
1972-11-06 16:58:58
SELECT a < TIME'20:31:05' FROM t1;
a < TIME'20:31:05'
1
DROP TABLE t1;
SELECT '1972-11-06 16:58:58' < TIME'20:31:05';
'1972-11-06 16:58:58' < TIME'20:31:05'
1
#
# End of 10.4 tests
# End of 10.4 tests
#
#
mysql-test/main/type_time.test
View file @
7b33a6a1
...
@@ -1430,6 +1430,23 @@ INSERT INTO t1 VALUES (3e19);
...
@@ -1430,6 +1430,23 @@ INSERT INTO t1 VALUES (3e19);
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-18876 Assertion `is_valid_time_slow()' failed in Time::valid_MYSQL_TIME_to_valid_value
--
echo
#
CREATE
TABLE
t1
(
f
INT
);
INSERT
INTO
t1
VALUES
(
1
),(
2
);
SELECT
DISTINCT
f
FROM
t1
ORDER
BY
1
&&
(
'1972-11-06 16:58:58'
BETWEEN
CONVERT
(
0
,
TIME
)
AND
'20:31:05'
);
DROP
TABLE
t1
;
CREATE
OR
REPLACE
TABLE
t1
(
a
VARCHAR
(
32
));
INSERT
INTO
t1
VALUES
(
'1972-11-06 16:58:58'
);
SELECT
*
FROM
t1
WHERE
a
<
TIME
'20:31:05'
;
SELECT
a
<
TIME
'20:31:05'
FROM
t1
;
DROP
TABLE
t1
;
SELECT
'1972-11-06 16:58:58'
<
TIME
'20:31:05'
;
--
echo
#
--
echo
#
--
echo
# End of 10.4 tests
--
echo
# End of 10.4 tests
--
echo
#
--
echo
#
mysql-test/main/type_time_hires.result
View file @
7b33a6a1
...
@@ -67,8 +67,10 @@ a
...
@@ -67,8 +67,10 @@ a
01:02:03.4567
01:02:03.4567
select extract(microsecond from a + interval 100 microsecond) from t1 where a>'2010-11-12 01:02:03.456';
select extract(microsecond from a + interval 100 microsecond) from t1 where a>'2010-11-12 01:02:03.456';
extract(microsecond from a + interval 100 microsecond)
extract(microsecond from a + interval 100 microsecond)
456800
select a from t1 where a>'2010-11-12 01:02:03.456' group by a;
select a from t1 where a>'2010-11-12 01:02:03.456' group by a;
a
a
01:02:03.4567
show create table t1;
show create table t1;
Table Create Table
Table Create Table
t1 CREATE TABLE `t1` (
t1 CREATE TABLE `t1` (
...
@@ -115,6 +117,11 @@ NULL
...
@@ -115,6 +117,11 @@ NULL
delete from t1 where a < 20110101;
delete from t1 where a < 20110101;
select * from t1;
select * from t1;
a
a
01:02:13.3332
NULL
delete from t1 where a is not null;
select * from t1;
a
NULL
NULL
create table t2 select * from t1;
create table t2 select * from t1;
create table t3 like t1;
create table t3 like t1;
...
...
sql/item.cc
View file @
7b33a6a1
...
@@ -129,6 +129,20 @@ longlong Item::val_datetime_packed_result(THD *thd)
...
@@ -129,6 +129,20 @@ longlong Item::val_datetime_packed_result(THD *thd)
}
}
longlong
Item
::
val_time_packed_result
(
THD
*
thd
)
{
MYSQL_TIME
ltime
;
if
(
get_date_result
(
thd
,
&
ltime
,
Time
::
Options_cmp
(
thd
)))
return
0
;
if
(
ltime
.
time_type
==
MYSQL_TIMESTAMP_TIME
)
return
pack_time
(
&
ltime
);
int
warn
=
0
;
Time
tmp
(
&
warn
,
&
ltime
,
0
);
DBUG_ASSERT
(
tmp
.
is_valid_time
());
return
tmp
.
to_packed
();
}
/*
/*
For the items which don't have its own fast val_str_ascii()
For the items which don't have its own fast val_str_ascii()
implementation we provide a generic slower version,
implementation we provide a generic slower version,
...
...
sql/item.h
View file @
7b33a6a1
...
@@ -1708,12 +1708,7 @@ class Item: public Value_source,
...
@@ -1708,12 +1708,7 @@ class Item: public Value_source,
return
Time
(
thd
,
this
,
Time
::
Options_cmp
(
thd
)).
to_packed
();
return
Time
(
thd
,
this
,
Time
::
Options_cmp
(
thd
)).
to_packed
();
}
}
longlong
val_datetime_packed_result
(
THD
*
thd
);
longlong
val_datetime_packed_result
(
THD
*
thd
);
longlong
val_time_packed_result
(
THD
*
thd
)
longlong
val_time_packed_result
(
THD
*
thd
);
{
MYSQL_TIME
ltime
;
return
get_date_result
(
thd
,
&
ltime
,
Time
::
Options_cmp
(
thd
))
?
0
:
pack_time
(
&
ltime
);
}
virtual
bool
get_date_result
(
THD
*
thd
,
MYSQL_TIME
*
ltime
,
date_mode_t
fuzzydate
)
virtual
bool
get_date_result
(
THD
*
thd
,
MYSQL_TIME
*
ltime
,
date_mode_t
fuzzydate
)
{
return
get_date
(
thd
,
ltime
,
fuzzydate
);
}
{
return
get_date
(
thd
,
ltime
,
fuzzydate
);
}
...
...
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