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
48c11d40
Commit
48c11d40
authored
Mar 13, 2018
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-13202 Assertion `ltime->neg == 0' failed in date_to_datetime
parent
4a35e76f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
0 deletions
+42
-0
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+24
-0
mysql-test/t/func_time.test
mysql-test/t/func_time.test
+16
-0
sql/sql_time.cc
sql/sql_time.cc
+2
-0
No files found.
mysql-test/r/func_time.result
View file @
48c11d40
...
...
@@ -2878,5 +2878,29 @@ NULL
Warnings:
Warning 1441 Datetime function: datetime field overflow
#
# MDEV-13202 Assertion `ltime->neg == 0' failed in date_to_datetime
#
CREATE TABLE t1 (i INT, d DATE);
INSERT INTO t1 VALUES (1, '1970-01-01');
SELECT MAX(NULLIF(i,1)) FROM t1 ORDER BY DATE_SUB(d,INTERVAL 17300000 HOUR);
MAX(NULLIF(i,1))
NULL
Warnings:
Warning 1441 Datetime function: datetime field overflow
DROP TABLE t1;
CREATE TABLE t1 (i INT, d DATE);
INSERT INTO t1 VALUES (1, '1970-01-01');
SELECT CONCAT(DATE_SUB(d, INTERVAL 17300000 HOUR)) FROM t1;
CONCAT(DATE_SUB(d, INTERVAL 17300000 HOUR))
NULL
Warnings:
Warning 1441 Datetime function: datetime field overflow
DROP TABLE t1;
SELECT CONCAT(DATE_SUB(TIMESTAMP'1970-01-01 00:00:00', INTERVAL 17300000 HOUR));
CONCAT(DATE_SUB(TIMESTAMP'1970-01-01 00:00:00', INTERVAL 17300000 HOUR))
NULL
Warnings:
Warning 1441 Datetime function: datetime field overflow
#
# End of 10.0 tests
#
mysql-test/t/func_time.test
View file @
48c11d40
...
...
@@ -1758,6 +1758,22 @@ SELECT ADDDATE(DATE'0000-01-01', INTERVAL '3652423:0:0:315569433559' DAY_SECOND)
SELECT
ADDDATE
(
DATE
'0000-01-01'
,
INTERVAL
'0:87658175:0:315569433559'
DAY_SECOND
);
SELECT
ADDDATE
(
DATE
'0000-01-01'
,
INTERVAL
'0:0:5259490559:315569433599'
DAY_SECOND
);
--
echo
#
--
echo
# MDEV-13202 Assertion `ltime->neg == 0' failed in date_to_datetime
--
echo
#
CREATE
TABLE
t1
(
i
INT
,
d
DATE
);
INSERT
INTO
t1
VALUES
(
1
,
'1970-01-01'
);
SELECT
MAX
(
NULLIF
(
i
,
1
))
FROM
t1
ORDER
BY
DATE_SUB
(
d
,
INTERVAL
17300000
HOUR
);
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
i
INT
,
d
DATE
);
INSERT
INTO
t1
VALUES
(
1
,
'1970-01-01'
);
SELECT
CONCAT
(
DATE_SUB
(
d
,
INTERVAL
17300000
HOUR
))
FROM
t1
;
DROP
TABLE
t1
;
SELECT
CONCAT
(
DATE_SUB
(
TIMESTAMP
'1970-01-01 00:00:00'
,
INTERVAL
17300000
HOUR
));
--
echo
#
--
echo
# End of 10.0 tests
...
...
sql/sql_time.cc
View file @
48c11d40
...
...
@@ -960,6 +960,8 @@ bool date_add_interval(MYSQL_TIME *ltime, interval_type int_type,
ltime
->
day
=
0
;
return
0
;
}
else
if
(
ltime
->
neg
)
goto
invalid_date
;
if
(
int_type
!=
INTERVAL_DAY
)
ltime
->
time_type
=
MYSQL_TIMESTAMP_DATETIME
;
// Return full date
...
...
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