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

Assertion `Item_cache_temporal::field_type() != MYSQL_TYPE_TIME' failed in Item_cache_temporal::val_datetime_packed

    XMLWordPrintable

Details

    Description

      It appears to be a recent regression. reproducible on current 27d94b7e032, not reproducible on c14733f64e (before the latest bunch of fixes/cleanups around datetimes). Most of intermediate commits don't build, so I can't say for sure which one is to blame.

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (d DATE) ENGINE=InnoDB;
      INSERT INTO t1 VALUES ('2012-12-21');
      SELECT * FROM t1 WHERE LEAST( UTC_TIME(), d );
       
      # Cleanup
      DROP TABLE t1;
      

      10.2 27d94b7e032

      mysqld: /home/elenst/10.2/sql/item.cc:9708: virtual longlong Item_cache_temporal::val_datetime_packed(): Assertion `Item_cache_temporal::field_type() != MYSQL_TYPE_TIME' failed.
      180315  1:13:50 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f0e719bfbf2 in __GI___assert_fail (assertion=0x55b40b2efaf8 "Item_cache_temporal::field_type() != MYSQL_TYPE_TIME", file=0x55b40b2eece0 "/home/elenst/10.2/sql/item.cc", line=9708, function=0x55b40b2f2a40 <Item_cache_temporal::val_datetime_packed()::__PRETTY_FUNCTION__> "virtual longlong Item_cache_temporal::val_datetime_packed()") at assert.c:101
      #8  0x000055b40aa2f4d9 in Item_cache_temporal::val_datetime_packed (this=0x7f0e1c015230) at /home/elenst/10.2/sql/item.cc:9708
      #9  0x000055b40aa33fc9 in Item::val_temporal_packed (this=0x7f0e1c015230, f_type=MYSQL_TYPE_DATETIME) at /home/elenst/10.2/sql/item.h:1424
      #10 0x000055b40aa7f241 in Item_func_min_max::get_date (this=0x7f0e1c012f88, ltime=0x7f0e6c0dcd30, fuzzy_date=0) at /home/elenst/10.2/sql/item_func.cc:2873
      #11 0x000055b40aa7f93d in Item_func_min_max::val_int (this=0x7f0e1c012f88) at /home/elenst/10.2/sql/item_func.cc:2989
      #12 0x000055b40a8004e5 in evaluate_join_record (join=0x7f0e1c013158, join_tab=0x7f0e1c0148e0, error=0) at /home/elenst/10.2/sql/sql_select.cc:18786
      #13 0x000055b40a80010c in sub_select (join=0x7f0e1c013158, join_tab=0x7f0e1c0148e0, end_of_records=false) at /home/elenst/10.2/sql/sql_select.cc:18691
      #14 0x000055b40a7ff693 in do_select (join=0x7f0e1c013158, procedure=0x0) at /home/elenst/10.2/sql/sql_select.cc:18235
      #15 0x000055b40a7da1b3 in JOIN::exec_inner (this=0x7f0e1c013158) at /home/elenst/10.2/sql/sql_select.cc:3566
      #16 0x000055b40a7d9662 in JOIN::exec (this=0x7f0e1c013158) at /home/elenst/10.2/sql/sql_select.cc:3361
      #17 0x000055b40a7da824 in mysql_select (thd=0x7f0e1c000b00, tables=0x7f0e1c012708, wild_num=1, fields=..., conds=0x7f0e1c012f88, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f0e1c013138, unit=0x7f0e1c0046a8, select_lex=0x7f0e1c004de0) at /home/elenst/10.2/sql/sql_select.cc:3761
      #18 0x000055b40a7ceef9 in handle_select (thd=0x7f0e1c000b00, lex=0x7f0e1c0045e0, result=0x7f0e1c013138, setup_tables_done_option=0) at /home/elenst/10.2/sql/sql_select.cc:364
      #19 0x000055b40a79adcf in execute_sqlcom_select (thd=0x7f0e1c000b00, all_tables=0x7f0e1c012708) at /home/elenst/10.2/sql/sql_parse.cc:6456
      #20 0x000055b40a790b59 in mysql_execute_command (thd=0x7f0e1c000b00) at /home/elenst/10.2/sql/sql_parse.cc:3467
      #21 0x000055b40a79e7de in mysql_parse (thd=0x7f0e1c000b00, rawbuf=0x7f0e1c0124f8 "SELECT * FROM t1 WHERE LEAST( UTC_TIME(), d )", length=45, parser_state=0x7f0e6c0de200, is_com_multi=false, is_next_command=false) at /home/elenst/10.2/sql/sql_parse.cc:7902
      #22 0x000055b40a78c468 in dispatch_command (command=COM_QUERY, thd=0x7f0e1c000b00, packet=0x7f0e1c08cbc1 "", packet_length=45, is_com_multi=false, is_next_command=false) at /home/elenst/10.2/sql/sql_parse.cc:1806
      #23 0x000055b40a78ae04 in do_command (thd=0x7f0e1c000b00) at /home/elenst/10.2/sql/sql_parse.cc:1359
      #24 0x000055b40a8d8265 in do_handle_one_connection (connect=0x55b40e188c20) at /home/elenst/10.2/sql/sql_connect.cc:1335
      #25 0x000055b40a8d7fe5 in handle_one_connection (arg=0x55b40e188c20) at /home/elenst/10.2/sql/sql_connect.cc:1241
      #26 0x000055b40b1103aa in pfs_spawn_thread (arg=0x55b40e16b430) at /home/elenst/10.2/storage/perfschema/pfs.cc:1862
      #27 0x00007f0e726086da in start_thread (arg=0x7f0e6c0df700) at pthread_create.c:456
      #28 0x00007f0e71a9ad7f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
      

      Attachments

        Activity

          People

            serg Sergei Golubchik
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.