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

Assertion `args[0]->type_handler()->mysql_timestamp_type() == MYSQL_TIMESTAMP_DATETIME' failed in virtual bool Item_func_round::date_op(THD*, MYSQL_TIME*, date_mode_t)

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
    • 10.4, 10.5, 10.6, 10.11
    • None

    Description

      CREATE TABLE t (a TIMESTAMP) ENGINE=MEMORY;
      SET sql_mode=0;
      INSERT INTO t VALUES (0);
      SELECT ROUND (a) AS f FROM t GROUP BY a WITH ROLLUP;
      

      Leads to:

      10.11.2 922f7ba75c864a9ae4d0e55fa66860dae306136f (Debug)

      mysqld: /test/10.11_dbg/sql/item_func.cc:2760: virtual bool Item_func_round::date_op(THD*, MYSQL_TIME*, date_mode_t): Assertion `args[0]->type_handler()->mysql_timestamp_type() == MYSQL_TIMESTAMP_DATETIME' failed.
      

      10.11.2 922f7ba75c864a9ae4d0e55fa66860dae306136f (Debug)

      Core was generated by `/test/MD071222-mariadb-10.11.2-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x1474b8112700 (LWP 2757321))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x00001474d04ca859 in __GI_abort () at abort.c:79
      #2  0x00001474d04ca729 in __assert_fail_base (fmt=0x1474d0660588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x561ca5752ac8 "args[0]->type_handler()->mysql_timestamp_type() == MYSQL_TIMESTAMP_DATETIME", file=0x561ca5751d50 "/test/10.11_dbg/sql/item_func.cc", line=2760, function=<optimized out>) at assert.c:92
      #3  0x00001474d04dbfd6 in __GI___assert_fail (assertion=assertion@entry=0x561ca5752ac8 "args[0]->type_handler()->mysql_timestamp_type() == MYSQL_TIMESTAMP_DATETIME", file=file@entry=0x561ca5751d50 "/test/10.11_dbg/sql/item_func.cc", line=line@entry=2760, function=function@entry=0x561ca5752b18 "virtual bool Item_func_round::date_op(THD*, MYSQL_TIME*, date_mode_t)") at assert.c:101
      #4  0x0000561ca4d5bde8 in Item_func_round::date_op (this=0x14748c013828, thd=0x14748c000d48, to=0x1474b810ff78, fuzzydate=<optimized out>) at /test/10.11_dbg/sql/item_func.cc:2760
      #5  0x0000561ca4bdba2e in Type_handler_temporal_result::Item_func_hybrid_field_type_get_date (this=<optimized out>, thd=<optimized out>, item=<optimized out>, warn=<optimized out>, ltime=0x1474b810ff78, fuzzydate=<optimized out>) at /test/10.11_dbg/sql/sql_type.cc:5546
      #6  0x0000561ca4bf6617 in Type_handler::Item_func_hybrid_field_type_get_date_with_warn (this=0x561ca5fad640 <type_handler_datetime2>, thd=thd@entry=0x14748c000d48, item=item@entry=0x14748c013828, ltime=ltime@entry=0x1474b810ff78, mode=mode@entry={m_mode = date_mode_t::FRAC_TRUNCATE}) at /test/10.11_dbg/sql/sql_type.cc:5130
      #7  0x0000561ca4d2cd59 in Item_func_hybrid_field_type::get_date (this=this@entry=0x14748c013828, thd=0x14748c000d48, to=to@entry=0x1474b810ff78, mode={m_mode = date_mode_t::FRAC_TRUNCATE}) at /test/10.11_dbg/sql/sql_type.h:7431
      #8  0x0000561ca4bf79ad in Type_handler::Item_send_datetime (this=<optimized out>, item=0x14748c013828, protocol=0x14748c001358, buf=0x1474b810ff70) at /test/10.11_dbg/sql/sql_basic_types.h:81
      #9  0x0000561ca4b3564b in Type_handler_datetime_common::Item_send (this=<optimized out>, item=<optimized out>, protocol=<optimized out>, buf=<optimized out>) at /test/10.11_dbg/sql/sql_type.h:6464
      #10 0x0000561ca48ca498 in Item::send (this=0x14748c013828, protocol=0x14748c001358, buffer=0x1474b810ff70) at /test/10.11_dbg/sql/item.h:1235
      #11 0x0000561ca48ff56d in Protocol::send_result_set_row (this=this@entry=0x14748c001358, row_items=row_items@entry=0x14748c015458) at /test/10.11_dbg/sql/protocol.cc:1332
      #12 0x0000561ca4987ff5 in select_send::send_data (this=0x14748c014ae8, items=@0x14748c015458: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14748c0154e8, last = 0x14748c0154e8, elements = 1}, <No data fields>}) at /test/10.11_dbg/sql/sql_class.cc:3103
      #13 0x0000561ca4a64121 in select_result_sink::send_data_with_check (sent=<optimized out>, u=<optimized out>, items=<optimized out>, this=<optimized out>) at /test/10.11_dbg/sql/sql_class.h:5721
      #14 JOIN::rollup_send_data (this=this@entry=0x14748c014b10, idx=idx@entry=0) at /test/10.11_dbg/sql/sql_select.cc:27542
      #15 0x0000561ca4a648aa in end_send_group (join=join@entry=0x14748c014b10, join_tab=join_tab@entry=0x0, end_of_records=end_of_records@entry=true) at /test/10.11_dbg/sql/sql_select.cc:23250
      #16 0x0000561ca4a77697 in do_select (procedure=<optimized out>, join=0x14748c014b10) at /test/10.11_dbg/sql/sql_select.cc:21328
      #17 JOIN::exec_inner (this=this@entry=0x14748c014b10) at /test/10.11_dbg/sql/sql_select.cc:4824
      #18 0x0000561ca4a77e1e in JOIN::exec (this=this@entry=0x14748c014b10) at /test/10.11_dbg/sql/sql_select.cc:4602
      #19 0x0000561ca4a75e2e in mysql_select (thd=thd@entry=0x14748c000d48, tables=0x14748c013938, fields=@0x14748c013488: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14748c0138e8, last = 0x14748c0138e8, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x14748c014188, having=0x0, proc_param=0x0, select_options=2164525824, result=0x14748c014ae8, unit=0x14748c004f88, select_lex=0x14748c0131e8) at /test/10.11_dbg/sql/sql_select.cc:5082
      #20 0x0000561ca4a765a1 in handle_select (thd=thd@entry=0x14748c000d48, lex=lex@entry=0x14748c004eb0, result=result@entry=0x14748c014ae8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_dbg/sql/sql_select.cc:582
      #21 0x0000561ca49e4025 in execute_sqlcom_select (thd=thd@entry=0x14748c000d48, all_tables=0x14748c013938) at /test/10.11_dbg/sql/sql_parse.cc:6263
      #22 0x0000561ca49f0144 in mysql_execute_command (thd=thd@entry=0x14748c000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:3947
      #23 0x0000561ca49de4aa in mysql_parse (thd=thd@entry=0x14748c000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1474b8111300) at /test/10.11_dbg/sql/sql_parse.cc:7998
      #24 0x0000561ca49eb9e9 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14748c000d48, packet=packet@entry=0x14748c00adf9 "", packet_length=packet_length@entry=51, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1346
      #25 0x0000561ca49ede22 in do_command (thd=0x14748c000d48, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1407
      #26 0x0000561ca4b4865f in do_handle_one_connection (connect=<optimized out>, connect@entry=0x561ca7c1e6e8, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1415
      #27 0x0000561ca4b48b2e in handle_one_connection (arg=0x561ca7c1e6e8) at /test/10.11_dbg/sql/sql_connect.cc:1317
      #28 0x00001474d09db609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #29 0x00001474d05c7133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.4.28 (dbg), 10.5.19 (dbg), 10.6.12 (dbg), 10.7.8 (dbg), 10.8.7 (dbg), 10.9.5 (dbg), 10.10.3 (dbg), 10.11.2 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.3.38 (dbg), 10.3.38 (opt), 10.4.28 (opt), 10.5.19 (opt), 10.6.12 (opt), 10.7.8 (opt), 10.8.7 (opt), 10.9.5 (opt), 10.10.3 (opt), 10.11.2 (opt)

      Attachments

        Activity

          People

            bar Alexander Barkov
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.