Skip to content

Commit b316989

Browse files
committed
MDEV-18072 Assertion `is_null() == item->null_value || conv' failed in Timestamp_or_zero_datetime_native_null::Timestamp_or_zero_datetime_native_null upon query with GROUP BY
1 parent a8eb0c7 commit b316989

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

mysql-test/main/type_time.result

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,5 +2177,14 @@ ERROR 22007: Incorrect time value: '0000-00-00 00:00:00' for column `test`.`t1`.
21772177
SET sql_mode=DEFAULT;
21782178
DROP TABLE t1;
21792179
#
2180+
# MDEV-18070 Assertion `nanoseconds <= 1000000000' failed in Temporal::add_nanoseconds_ssff with TIME_ROUND_FRACTIONAL
2181+
#
2182+
CREATE TABLE t1 (t TIME);
2183+
SET SQL_MODE= 'TIME_ROUND_FRACTIONAL';
2184+
INSERT INTO t1 VALUES (3e19);
2185+
Warnings:
2186+
Warning 1264 Out of range value for column 't' at row 1
2187+
DROP TABLE t1;
2188+
#
21802189
# End of 10.4 tests
21812190
#

mysql-test/main/type_time.test

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,6 +1420,15 @@ INSERT INTO t1 VALUES ('0000-00-00 00:00:00'),('0000-00-00 00:00:00');
14201420
SET sql_mode=DEFAULT;
14211421
DROP TABLE t1;
14221422

1423+
--echo #
1424+
--echo # MDEV-18070 Assertion `nanoseconds <= 1000000000' failed in Temporal::add_nanoseconds_ssff with TIME_ROUND_FRACTIONAL
1425+
--echo #
1426+
1427+
CREATE TABLE t1 (t TIME);
1428+
SET SQL_MODE= 'TIME_ROUND_FRACTIONAL';
1429+
INSERT INTO t1 VALUES (3e19);
1430+
DROP TABLE t1;
1431+
14231432

14241433
--echo #
14251434
--echo # End of 10.4 tests

sql/sql_type.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ void Sec6::make_from_double(double nr, ulong *nanoseconds)
331331
{
332332
m_sec= LONGLONG_MAX;
333333
m_usec= 0;
334+
*nanoseconds= 0;
334335
}
335336
else
336337
{

0 commit comments

Comments
 (0)