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

Assertion `ltime->neg == 0' failed in date_to_datetime

    XMLWordPrintable

Details

    • 10.2.14

    Description

      CREATE TABLE t1 (i INT, d DATE);
      INSERT INTO t1 VALUES (1, '1970-01-01');
      SELECT MAX( NULLIF( i, 1 ) ) FROM t1 ORDER BY DATE_SUB( d, INTERVAL 17300000 HOUR );
       
      # Cleanup
      DROP TABLE t1;
      

      10.0 9216a4f69f1

      mysqld: /data/src/10.0/sql/sql_time.h:79: void date_to_datetime(MYSQL_TIME*): Assertion `ltime->neg == 0' failed.
      180215 16:26:53 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fcc273f7ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x0000000000900d9c in date_to_datetime (ltime=0x7fcc294c62d0) at /data/src/10.0/sql/sql_time.h:79
      #9  0x00000000008f9d4b in Item_temporal_hybrid_func::fix_temporal_type (this=0x7fcc1f8fae98, ltime=0x7fcc294c62d0) at /data/src/10.0/sql/item_timefunc.cc:1531
      #10 0x00000000008f9e02 in Item_temporal_hybrid_func::val_str_ascii (this=0x7fcc1f8fae98, str=0x7fcc1fbb8c78) at /data/src/10.0/sql/item_timefunc.cc:1551
      #11 0x00000000008c083c in Item_func::val_str_from_val_str_ascii (this=0x7fcc1f8fae98, str=0x7fcc1fbb8c78, ascii_buffer=0x7fcc1f8faf70) at /data/src/10.0/sql/item_strfunc.cc:89
      #12 0x00000000009001d0 in Item_temporal_hybrid_func::val_str (this=0x7fcc1f8fae98, str=0x7fcc1fbb8c78) at /data/src/10.0/sql/item_timefunc.h:560
      #13 0x00000000008561b0 in Item_copy_string::copy (this=0x7fcc1fbb8c60) at /data/src/10.0/sql/item.cc:4182
      #14 0x00000000006b81e3 in copy_fields (param=0x7fcc1f8fb2b8) at /data/src/10.0/sql/sql_select.cc:22409
      #15 0x00000000006b0825 in end_send_group (join=0x7fcc1f8fb0a8, join_tab=0x0, end_of_records=false) at /data/src/10.0/sql/sql_select.cc:19290
      #16 0x00000000006acb7b in do_select (join=0x7fcc1f8fb0a8, fields=0x7fcc1f8fb490, table=0x0, procedure=0x0) at /data/src/10.0/sql/sql_select.cc:17591
      #17 0x0000000000689b61 in JOIN::exec_inner (this=0x7fcc1f8fb0a8) at /data/src/10.0/sql/sql_select.cc:3108
      #18 0x000000000068701e in JOIN::exec (this=0x7fcc1f8fb0a8) at /data/src/10.0/sql/sql_select.cc:2394
      #19 0x000000000068a3c0 in mysql_select (thd=0x7fcc212a2070, rref_pointer_array=0x7fcc212a63a0, tables=0x7fcc1f8fa6e8, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x7fcc1f8faf98, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fcc1f8fb088, unit=0x7fcc212a5a08, select_lex=0x7fcc212a60f8) at /data/src/10.0/sql/sql_select.cc:3333
      #20 0x000000000068061e in handle_select (thd=0x7fcc212a2070, lex=0x7fcc212a5940, result=0x7fcc1f8fb088, setup_tables_done_option=0) at /data/src/10.0/sql/sql_select.cc:377
      #21 0x0000000000654dbd in execute_sqlcom_select (thd=0x7fcc212a2070, all_tables=0x7fcc1f8fa6e8) at /data/src/10.0/sql/sql_parse.cc:5293
      #22 0x000000000064d356 in mysql_execute_command (thd=0x7fcc212a2070) at /data/src/10.0/sql/sql_parse.cc:2553
      #23 0x0000000000657a3e in mysql_parse (thd=0x7fcc212a2070, rawbuf=0x7fcc1f8fa088 "SELECT MAX( NULLIF( i, 1 ) ) FROM t1 ORDER BY DATE_SUB( d, INTERVAL 17300000 HOUR )", length=83, parser_state=0x7fcc294c7640) at /data/src/10.0/sql/sql_parse.cc:6569
      #24 0x000000000064a57d in dispatch_command (command=COM_QUERY, thd=0x7fcc212a2070, packet=0x7fcc227e5071 "", packet_length=83) at /data/src/10.0/sql/sql_parse.cc:1296
      #25 0x000000000064987d in do_command (thd=0x7fcc212a2070) at /data/src/10.0/sql/sql_parse.cc:999
      #26 0x0000000000769a04 in do_handle_one_connection (thd_arg=0x7fcc212a2070) at /data/src/10.0/sql/sql_connect.cc:1377
      #27 0x0000000000769776 in handle_one_connection (arg=0x7fcc212a2070) at /data/src/10.0/sql/sql_connect.cc:1292
      #28 0x0000000000aca0fc in pfs_spawn_thread (arg=0x7fcc211a2370) at /data/src/10.0/storage/perfschema/pfs.cc:1861
      #29 0x00007fcc290fb494 in start_thread (arg=0x7fcc294c8700) at pthread_create.c:333
      #30 0x00007fcc274b493f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Reproducible with 10.0-10.3. Not reproducible with 5.5 or MySQL 5.6.
      No visible effect on non-debug builds.

      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.