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

Assertion `time_type == MYSQL_TIMESTAMP_DATETIME' failed in Datetime::is_valid_datetime_slow

    XMLWordPrintable

Details

    Description

      USE test;
      CREATE TABLE t(c INT DEFAULT (1 LIKE (NOW() BETWEEN '' AND '')));
      INSERT DELAYED INTO t VALUES(1);
      

      Leads to:

      10.4.13 edc3899d9781e98b4328931884527913ebffb11f

      mysqld: /test/10.4_dbg/sql/sql_type.h:1996: bool Datetime::is_valid_datetime_slow() const: Assertion `time_type == MYSQL_TIMESTAMP_DATETIME' failed.
      

      10.4.13 edc3899d9781e98b4328931884527913ebffb11f

      Core was generated by `/test/MD110420-mariadb-10.4.13-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      [Current thread is 1 (Thread 0x14df6b6f9700 (LWP 87237))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x000055c37dcef36b in my_write_core (sig=sig@entry=6) at /test/10.4_dbg/mysys/stacktrace.c:481
      #2  0x000055c37d47ca62 in handle_fatal_signal (sig=6) at /test/10.4_dbg/sql/signal_handler.cc:343
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x000014df69c06801 in __GI_abort () at abort.c:79
      #6  0x000014df69bf639a in __assert_fail_base (fmt=0x14df69d7d7d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55c37dd9d090 "time_type == MYSQL_TIMESTAMP_DATETIME", file=file@entry=0x55c37dd9cf3f "/test/10.4_dbg/sql/sql_type.h", line=line@entry=1996, function=function@entry=0x55c37dd9d420 <Datetime::is_valid_datetime_slow() const::__PRETTY_FUNCTION__> "bool Datetime::is_valid_datetime_slow() const") at assert.c:92
      #7  0x000014df69bf6412 in __GI___assert_fail (assertion=assertion@entry=0x55c37dd9d090 "time_type == MYSQL_TIMESTAMP_DATETIME", file=file@entry=0x55c37dd9cf3f "/test/10.4_dbg/sql/sql_type.h", line=line@entry=1996, function=function@entry=0x55c37dd9d420 <Datetime::is_valid_datetime_slow() const::__PRETTY_FUNCTION__> "bool Datetime::is_valid_datetime_slow() const") at assert.c:101
      #8  0x000055c37d0daba0 in Datetime::is_valid_datetime_slow (this=0x14df6b6f59b0) at /test/10.4_dbg/sql/sql_type.h:1996
      #9  Datetime::is_valid_value_slow (this=0x14df6b6f59b0) at /test/10.4_dbg/sql/sql_type.h:1992
      #10 Datetime::Datetime (fuzzydate=..., item=0x14df448408e0, thd=0x14df444e4090, this=0x14df6b6f59b0) at /test/10.4_dbg/sql/sql_type.h:2064
      #11 Item::val_datetime_packed (this=0x14df448408e0, thd=0x14df444e4090) at /test/10.4_dbg/sql/item.h:1758
      #12 0x000055c37d4cfa01 in Item_func_between::val_int_cmp_datetime (this=0x14df44840c98) at /test/10.4_dbg/sql/item_cmpfunc.cc:2168
      #13 0x000055c37d37c408 in Type_handler_temporal_with_date::Item_func_between_val_int (this=<optimized out>, func=<optimized out>) at /test/10.4_dbg/sql/sql_type.cc:5013
      #14 0x000055c37d61507d in Item_func_between::val_int (this=0x14df44840c98) at /test/10.4_dbg/sql/item_cmpfunc.h:913
      #15 0x000055c37d5017a1 in Item_int_func::val_str (this=0x14df44840c98, str=0x14df44874db8) at /test/10.4_dbg/sql/item_func.cc:752
      #16 0x000055c37d4d5536 in Item_func_like::fix_fields (this=0x14df44874c88, thd=0x14df444e4090, ref=<optimized out>) at /test/10.4_dbg/sql/item_cmpfunc.cc:5637
      #17 0x000055c37d2b0f9b in fix_vcol_expr (thd=thd@entry=0x14df444e4090, vcol=vcol@entry=0x14df44840a00) at /test/10.4_dbg/sql/table.cc:3234
      #18 0x000055c37d2b1926 in fix_and_check_vcol_expr (vcol=0x14df44840a00, table=0x14df44894070, thd=0x14df444e4090) at /test/10.4_dbg/sql/table.cc:3319
      #19 unpack_vcol_info_from_frm (thd=thd@entry=0x14df444e4090, mem_root=mem_root@entry=0x14df44894d40, table=table@entry=0x14df44894070, expr_str=expr_str@entry=0x14df6b6f7da0, vcol_ptr=0x14df44840778, error_reported=error_reported@entry=0x14df6b6f8157) at /test/10.4_dbg/sql/table.cc:3446
      #20 0x000055c37d2b9bb3 in parse_vcol_defs (thd=thd@entry=0x14df444e4090, mem_root=mem_root@entry=0x14df44894d40, table=table@entry=0x14df44894070, error_reported=error_reported@entry=0x14df6b6f8157, mode=mode@entry=VCOL_INIT_DEPENDENCY_FAILURE_IS_WARNING) at /test/10.4_dbg/sql/table.cc:1179
      #21 0x000055c37d2c257a in open_table_from_share (thd=thd@entry=0x14df444e4090, share=share@entry=0x14df44825688, alias=alias@entry=0x14df444ea830, db_stat=db_stat@entry=33, prgflag=prgflag@entry=8, ha_open_flags=<optimized out>, outparam=<optimized out>, is_create_table=<optimized out>, partitions_to_open=<optimized out>) at /test/10.4_dbg/sql/table.cc:3816
      #22 0x000055c37d1427fe in open_table (thd=thd@entry=0x14df444e4090, table_list=table_list@entry=0x14df444ea7e8, ot_ctx=ot_ctx@entry=0x14df6b6f8b20) at /test/10.4_dbg/sql/sql_base.cc:2082
      #23 0x000055c37d146cb6 in open_and_process_table (ot_ctx=0x14df6b6f8b20, has_prelocking_list=false, prelocking_strategy=0x14df6b6f8ca8, flags=65537, counter=0x14df6b6f8bbc, tables=0x14df444ea7e8, thd=0x14df444e4090) at /test/10.4_dbg/sql/sql_base.cc:3850
      #24 open_tables (thd=thd@entry=0x14df444e4090, options=..., start=start@entry=0x14df6b6f8ba8, counter=counter@entry=0x14df6b6f8bbc, flags=flags@entry=65537, prelocking_strategy=prelocking_strategy@entry=0x14df6b6f8ca8) at /test/10.4_dbg/sql/sql_base.cc:4322
      #25 0x000055c37d147f89 in open_and_lock_tables (thd=thd@entry=0x14df444e4090, options=..., tables=<optimized out>, tables@entry=0x14df444ea7e8, derived=derived@entry=false, flags=flags@entry=65537, prelocking_strategy=prelocking_strategy@entry=0x14df6b6f8ca8) at /test/10.4_dbg/sql/sql_base.cc:5217
      #26 0x000055c37d148121 in open_and_lock_tables (prelocking_strategy=0x14df6b6f8ca8, flags=65537, derived=false, tables=0x14df444ea7e8, thd=0x14df444e4090) at /test/10.4_dbg/sql/sql_base.h:271
      #27 open_n_lock_single_table (thd=thd@entry=0x14df444e4090, table_l=table_l@entry=0x14df444ea7e8, lock_type=lock_type@entry=TL_WRITE_DELAYED, flags=flags@entry=65537, prelocking_strategy=prelocking_strategy@entry=0x14df6b6f8ca8) at /test/10.4_dbg/sql/sql_base.cc:5060
      #28 0x000055c37d187275 in Delayed_insert::open_and_lock_table (this=this@entry=0x14df444e4070) at /test/10.4_dbg/sql/sql_insert.cc:2970
      #29 0x000055c37d188aa6 in handle_delayed_insert (arg=0x14df444e4070) at /test/10.4_dbg/sql/sql_insert.cc:3073
      #30 0x000014df6a8e96db in start_thread (arg=0x14df6b6f9700) at pthread_create.c:463
      #31 0x000014df69ce788f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.23 (dbg), 10.4.13 (dbg), 10.5.2 (dbg), 10.5.3 (dbg), 10.5.6 (dbg) @ 1c587481966abc7a9ad5309d0a91ca920f7a5657

      Bug confirmed not present in:
      MariaDB: 10.1.45 (dbg), 10.1.45 (opt), 10.2.32 (dbg), 10.2.32 (opt), 10.3.23 (opt), 10.4.13 (opt), 10.5.2 (opt), 10.5.3 (opt), 10.5.4 (dbg), 10.5.4 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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