[MDEV-18070] Assertion `nanoseconds <= 1000000000' failed in Temporal::add_nanoseconds_ssff with TIME_ROUND_FRACTIONAL Created: 2018-12-24  Updated: 2018-12-25  Resolved: 2018-12-25

Status: Closed
Project: MariaDB Server
Component/s: Temporal Types
Affects Version/s: 10.4
Fix Version/s: 10.4.1

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None


 Description   

Note: the test case is non-deterministic (on whatever reason), run with --repeat=N if it doesn't fail right away. It fails for me in about 50% times, but it can vary on different machines and builds.

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

10.4 a8eb0c76bf

mysqld: /data/src/10.4/sql/sql_type.h:863: bool Temporal::add_nanoseconds_ssff(uint): Assertion `nanoseconds <= 1000000000' failed.
181224  3:21:41 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f7d3ffdaee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x000055a67161b50f in Temporal::add_nanoseconds_ssff (this=0x7f7d3a16b660, nanoseconds=1925416424) at /data/src/10.4/sql/sql_type.h:863
#9  0x000055a67161b5ee in Temporal::add_nanoseconds_mmssff (this=0x7f7d3a16b660, nanoseconds=1925416424) at /data/src/10.4/sql/sql_type.h:885
#10 0x000055a671605f03 in Temporal::time_round_or_set_max (this=0x7f7d3a16b660, dec=6, warn=0x7f7d3a16b64c, max_hour=838, nsec=94173378348520) at /data/src/10.4/sql/sql_type.cc:665
#11 0x000055a671605fa4 in Time::round_or_set_max (this=0x7f7d3a16b660, dec=6, warn=0x7f7d3a16b64c, nsec=94173378348520) at /data/src/10.4/sql/sql_type.cc:676
#12 0x000055a6717145c7 in Time::Time (this=0x7f7d3a16b660, thd=0x7f7d28000b00, warn=0x7f7d3a16b64c, nr=..., opt=...) at /data/src/10.4/sql/sql_type.h:1513
#13 0x000055a671714681 in Time::Time (this=0x7f7d3a16b660, thd=0x7f7d28000b00, warn=0x7f7d3a16b64c, nr=3e+19, opt=...) at /data/src/10.4/sql/sql_type.h:1521
#14 0x000055a67171489c in Time::Time (this=0x7f7d3a16b660, thd=0x7f7d28000b00, warn=0x7f7d3a16b64c, nr=3e+19, opt=..., dec=0) at /data/src/10.4/sql/sql_type.h:1566
#15 0x000055a6716fe877 in Field_time::store (this=0x7f7d2813a9b0, nr=3e+19) at /data/src/10.4/sql/field.cc:5824
#16 0x000055a671754be4 in Item_float::save_in_field (this=0x7f7d28015b10, field=0x7f7d2813a9b0, no_conversions=false) at /data/src/10.4/sql/item.cc:6780
#17 0x000055a6713914e8 in fill_record (thd=0x7f7d28000b00, table=0x7f7d28122c20, ptr=0x7f7d2813a9a8, values=..., ignore_errors=false, use_value=false) at /data/src/10.4/sql/sql_base.cc:8679
#18 0x000055a67139173b in fill_record_n_invoke_before_triggers (thd=0x7f7d28000b00, table=0x7f7d28122c20, ptr=0x7f7d2813a9a0, values=..., ignore_errors=false, event=TRG_EVENT_INSERT) at /data/src/10.4/sql/sql_base.cc:8732
#19 0x000055a6713d533e in mysql_insert (thd=0x7f7d28000b00, table_list=0x7f7d28015080, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /data/src/10.4/sql/sql_insert.cc:1006
#20 0x000055a67141bc59 in mysql_execute_command (thd=0x7f7d28000b00) at /data/src/10.4/sql/sql_parse.cc:4730
#21 0x000055a6714268e4 in mysql_parse (thd=0x7f7d28000b00, rawbuf=0x7f7d28014f98 "INSERT INTO t1 VALUES (3e19)", length=28, parser_state=0x7f7d3a16c600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8104
#22 0x000055a671413b0e in dispatch_command (command=COM_QUERY, thd=0x7f7d28000b00, packet=0x7f7d2800b421 "INSERT INTO t1 VALUES (3e19)", packet_length=28, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
#23 0x000055a671412532 in do_command (thd=0x7f7d28000b00) at /data/src/10.4/sql/sql_parse.cc:1396
#24 0x000055a67157e6de in do_handle_one_connection (connect=0x55a6739436b0) at /data/src/10.4/sql/sql_connect.cc:1402
#25 0x000055a67157e462 in handle_one_connection (arg=0x55a6739436b0) at /data/src/10.4/sql/sql_connect.cc:1308
#26 0x000055a671a3d338 in pfs_spawn_thread (arg=0x55a673887970) at /data/src/10.4/storage/perfschema/pfs.cc:1862
#27 0x00007f7d41a96494 in start_thread (arg=0x7f7d3a16d700) at pthread_create.c:333
#28 0x00007f7d4009793f in clone () from /lib/x86_64-linux-gnu/libc.so.6


Generated at Thu Feb 08 08:41:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.