Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-17854

Assertion `decimals <= 6' failed in my_time_fraction_remainder on SELECT with NULLIF and FROM_UNIXTIME on incorrect time

    XMLWordPrintable

Details

    Description

      SELECT NULLIF(FROM_UNIXTIME('foo'), '2012-12-12 21:10:14');
      

      10.4 7dcbc33db5

      mysqld: /data/src/10.4/include/my_time.h:233: long int my_time_fraction_remainder(long int, uint): Assertion `decimals <= 6' failed.
      181127 23:42:25 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f7177c43ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      7f7160000b00, item=0x7f7160015720, warn=0x7f7171de8e70, ltime=0x7f7171de9218, fuzzydate=...) at /data/src/10.4/sql/sql_type.cc:4609
      #15 0x0000560bf5749a7f in Type_handler::Item_func_hybrid_field_type_get_date_with_warn (this=0x560bf6b48150 <type_handler_datetime2>, thd=0x7f7160000b00, item=0x7f7160015720, ltime=0x7f7171de9218, mode=...) at /data/src/10.4/sql/sql_type.cc:4230
      #16 0x0000560bf553cbf3 in Item_func_hybrid_field_type::get_date (this=0x7f7160015720, thd=0x7f7160000b00, to=0x7f7171de9218, mode=...) at /data/src/10.4/sql/item_func.h:768
      #17 0x0000560bf574e891 in Type_handler::Item_send_datetime (this=0x560bf6b48150 <type_handler_datetime2>, item=0x7f7160015720, protocol=0x7f71600010b8, buf=0x7f7171de9210) at /data/src/10.4/sql/sql_type.cc:6485
      #18 0x0000560bf575987e in Type_handler_datetime_common::Item_send (this=0x560bf6b48150 <type_handler_datetime2>, item=0x7f7160015720, protocol=0x7f71600010b8, buf=0x7f7171de9210) at /data/src/10.4/sql/sql_type.h:5113
      #19 0x0000560bf544ae96 in Item::send (this=0x7f7160015720, protocol=0x7f71600010b8, buffer=0x7f7171de9210) at /data/src/10.4/sql/item.h:1013
      #20 0x0000560bf5445ab2 in Protocol::send_result_set_row (this=0x7f71600010b8, row_items=0x7f71600150d0) at /data/src/10.4/sql/protocol.cc:986
      #21 0x0000560bf54ed284 in select_send::send_data (this=0x7f7160016180, items=...) at /data/src/10.4/sql/sql_class.cc:2937
      #22 0x0000560bf55a28fd in JOIN::exec_inner (this=0x7f71600161a8) at /data/src/10.4/sql/sql_select.cc:3969
      #23 0x0000560bf55a2360 in JOIN::exec (this=0x7f71600161a8) at /data/src/10.4/sql/sql_select.cc:3888
      #24 0x0000560bf55a361f in mysql_select (thd=0x7f7160000b00, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f7160016180, unit=0x7f71600049b0, select_lex=0x7f7160014fa0) at /data/src/10.4/sql/sql_select.cc:4293
      #25 0x0000560bf5594f2b in handle_select (thd=0x7f7160000b00, lex=0x7f71600048e8, result=0x7f7160016180, setup_tables_done_option=0) at /data/src/10.4/sql/sql_select.cc:385
      #26 0x0000560bf555f2a2 in execute_sqlcom_select (thd=0x7f7160000b00, all_tables=0x0) at /data/src/10.4/sql/sql_parse.cc:6555
      #27 0x0000560bf5555912 in mysql_execute_command (thd=0x7f7160000b00) at /data/src/10.4/sql/sql_parse.cc:3774
      #28 0x0000560bf55630ae in mysql_parse (thd=0x7f7160000b00, rawbuf=0x7f7160014ec0 "SELECT NULLIF(FROM_UNIXTIME('foo'), '2012-12-12 21:10:14')", length=58, parser_state=0x7f7171dea600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8092
      #29 0x0000560bf555039c in dispatch_command (command=COM_QUERY, thd=0x7f7160000b00, packet=0x7f716011d471 "", packet_length=58, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
      #30 0x0000560bf554edc0 in do_command (thd=0x7f7160000b00) at /data/src/10.4/sql/sql_parse.cc:1396
      #31 0x0000560bf56ba442 in do_handle_one_connection (connect=0x560bf80832a0) at /data/src/10.4/sql/sql_connect.cc:1402
      #32 0x0000560bf56ba1c6 in handle_one_connection (arg=0x560bf80832a0) at /data/src/10.4/sql/sql_connect.cc:1308
      #33 0x0000560bf5b6e2e0 in pfs_spawn_thread (arg=0x560bf810b350) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #34 0x00007f71796ff494 in start_thread (arg=0x7f7171deb700) at pthread_create.c:333
      #35 0x00007f7177d0093f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      No crash on a non-debug build, just a duplicate warning:

      SELECT NULLIF(FROM_UNIXTIME('foo'), '2012-12-12 21:10:14');
      NULLIF(FROM_UNIXTIME('foo'), '2012-12-12 21:10:14')
      1970-01-01 02:00:00
      Warnings:
      Warning	1292	Truncated incorrect DECIMAL value: 'foo'
      Warning	1292	Truncated incorrect DECIMAL value: 'foo'
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.