mirror of
https://github.com/MariaDB/server.git
synced 2025-08-09 04:21:21 +00:00
MDEV-19301 Assertion `!is_valid_datetime() || fraction_remainder(((item->decimals) < (6) ? (item->decimals) : (6))) == 0' failed in Datetime_truncation_not_needed::Datetime_truncation_not_needed
This commit is contained in:
@ -1025,5 +1025,20 @@ INSERT INTO t1 SELECT * FROM t2;
|
|||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
SET sql_mode=DEFAULT;
|
SET sql_mode=DEFAULT;
|
||||||
#
|
#
|
||||||
|
# MDEV-19301 Assertion `!is_valid_datetime() || fraction_remainder(((item->decimals) < (6) ? (item->decimals) : (6))) == 0' failed in Datetime_truncation_not_needed::Datetime_truncation_not_needed
|
||||||
|
#
|
||||||
|
SELECT NULLIF(CAST(1012.5 AS DATE), 1);
|
||||||
|
NULLIF(CAST(1012.5 AS DATE), 1)
|
||||||
|
2000-10-12
|
||||||
|
Warnings:
|
||||||
|
Note 1292 Truncated incorrect date value: '1012.5'
|
||||||
|
Warning 1292 Truncated incorrect datetime value: '1'
|
||||||
|
Note 1292 Truncated incorrect date value: '1012.5'
|
||||||
|
SELECT CAST(1012.5 AS DATE) * 1.0;
|
||||||
|
CAST(1012.5 AS DATE) * 1.0
|
||||||
|
20001012.0
|
||||||
|
Warnings:
|
||||||
|
Note 1292 Truncated incorrect date value: '1012.5'
|
||||||
|
#
|
||||||
# End of 10.4 tests
|
# End of 10.4 tests
|
||||||
#
|
#
|
||||||
|
@ -691,6 +691,14 @@ DROP TABLE t1,t2;
|
|||||||
SET sql_mode=DEFAULT;
|
SET sql_mode=DEFAULT;
|
||||||
|
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-19301 Assertion `!is_valid_datetime() || fraction_remainder(((item->decimals) < (6) ? (item->decimals) : (6))) == 0' failed in Datetime_truncation_not_needed::Datetime_truncation_not_needed
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
SELECT NULLIF(CAST(1012.5 AS DATE), 1);
|
||||||
|
SELECT CAST(1012.5 AS DATE) * 1.0;
|
||||||
|
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # End of 10.4 tests
|
--echo # End of 10.4 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
@ -1728,7 +1728,11 @@ longlong number_to_datetime_or_date(longlong nr, ulong sec_part,
|
|||||||
!check_date(time_res, nr || sec_part, flags, was_cut))
|
!check_date(time_res, nr || sec_part, flags, was_cut))
|
||||||
{
|
{
|
||||||
if (time_res->time_type == MYSQL_TIMESTAMP_DATE && sec_part != 0)
|
if (time_res->time_type == MYSQL_TIMESTAMP_DATE && sec_part != 0)
|
||||||
|
{
|
||||||
|
/* Date format, but with fractional digits, e.g. 20010203.5 */
|
||||||
*was_cut= MYSQL_TIME_NOTE_TRUNCATED;
|
*was_cut= MYSQL_TIME_NOTE_TRUNCATED;
|
||||||
|
time_res->second_part= 0;
|
||||||
|
}
|
||||||
return nr;
|
return nr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user