Skip to content

Commit

Permalink
MDEV-18072 Assertion `is_null() == item->null_value || conv' failed i…
Browse files Browse the repository at this point in the history
…n Timestamp_or_zero_datetime_native_null::Timestamp_or_zero_datetime_native_null upon query with GROUP BY
  • Loading branch information
abarkov committed Dec 25, 2018
1 parent a8eb0c7 commit b316989
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mysql-test/main/type_time.result
Original file line number Diff line number Diff line change
Expand Up @@ -2177,5 +2177,14 @@ ERROR 22007: Incorrect time value: '0000-00-00 00:00:00' for column `test`.`t1`.
SET sql_mode=DEFAULT;
DROP TABLE t1;
#
# MDEV-18070 Assertion `nanoseconds <= 1000000000' failed in Temporal::add_nanoseconds_ssff with TIME_ROUND_FRACTIONAL
#
CREATE TABLE t1 (t TIME);
SET SQL_MODE= 'TIME_ROUND_FRACTIONAL';
INSERT INTO t1 VALUES (3e19);
Warnings:
Warning 1264 Out of range value for column 't' at row 1
DROP TABLE t1;
#
# End of 10.4 tests
#
9 changes: 9 additions & 0 deletions mysql-test/main/type_time.test
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,15 @@ INSERT INTO t1 VALUES ('0000-00-00 00:00:00'),('0000-00-00 00:00:00');
SET sql_mode=DEFAULT;
DROP TABLE t1;

--echo #
--echo # MDEV-18070 Assertion `nanoseconds <= 1000000000' failed in Temporal::add_nanoseconds_ssff with TIME_ROUND_FRACTIONAL
--echo #

CREATE TABLE t1 (t TIME);
SET SQL_MODE= 'TIME_ROUND_FRACTIONAL';
INSERT INTO t1 VALUES (3e19);
DROP TABLE t1;


--echo #
--echo # End of 10.4 tests
Expand Down
1 change: 1 addition & 0 deletions sql/sql_type.cc
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ void Sec6::make_from_double(double nr, ulong *nanoseconds)
{
m_sec= LONGLONG_MAX;
m_usec= 0;
*nanoseconds= 0;
}
else
{
Expand Down

0 comments on commit b316989

Please sign in to comment.