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

Assertion `(tm->tv_usec % (int) log_10_int[6 - dec]) == 0' failed in void my_timestamp_to_binary(const timeval*, uchar*, uint)

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
        
      CREATE TABLE t1(a TIMESTAMP,KEY(a)) ENGINE=INNODB;
      SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23' ;
      

      Leads to

      11.3.2 83a79ba33b0d39f005deeb3b2392cf85b7cf0fc5 (Debug)

      mariadbd: /test/11.3_dbg/sql/compat56.cc:442: void my_timestamp_to_binary(const timeval*, uchar*, uint): Assertion `(tm->tv_usec % (int) log_10_int[6 - dec]) == 0' failed.
      

      11.3.2 83a79ba33b0d39f005deeb3b2392cf85b7cf0fc5 (Debug)

      Core was generated by `/test/MD220124-mariadb-11.3.2-linux-x86_64-dbg/bin/mariadbd --no-defaults --cor'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x00001504378b3859 in __GI_abort () at abort.c:79
      #2  0x00001504378b3729 in __assert_fail_base (fmt=0x150437a49588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x556db5ccb130 "(tm->tv_usec % (int) log_10_int[6 - dec]) == 0", file=0x556db5ccad58 "/test/11.3_dbg/sql/compat56.cc", line=442, function=<optimized out>) at assert.c:92
      #3  0x00001504378c4fd6 in __GI___assert_fail (assertion=assertion@entry=0x556db5ccb130 "(tm->tv_usec % (int) log_10_int[6 - dec]) == 0", file=file@entry=0x556db5ccad58 "/test/11.3_dbg/sql/compat56.cc", line=line@entry=442, function=function@entry=0x556db5ccb0a8 "void my_timestamp_to_binary(const timeval*, uchar*, uint)") at assert.c:101
      #4  0x0000556db518ff18 in my_timestamp_to_binary (tm=tm@entry=0x1503fc017248, ptr=0x15043048f7a6 "", dec=dec@entry=0) at /test/11.3_dbg/sql/compat56.cc:442
      #5  0x0000556db50f12c3 in Timestamp::to_native (this=0x1503fc017248, to=0x15043048f790, decimals=0) at /test/11.3_dbg/sql/sql_string.h:359
      #6  0x0000556db50f1480 in Timestamp_or_zero_datetime::to_native (this=this@entry=0x1503fc017248, to=to@entry=0x15043048f790, decimals=<optimized out>) at /test/11.3_dbg/sql/sql_type.cc:436
      #7  0x0000556db520eb0c in Timestamp_or_zero_datetime_native::Timestamp_or_zero_datetime_native (decimals=<optimized out>, ts=..., this=0x15043048f790) at /test/11.3_dbg/sql/sql_type.h:2906
      #8  Item_timestamp_literal::save_in_field (this=0x1503fc0171d0, field=0x1503fc1faa20) at /test/11.3_dbg/sql/item.h:5025
      #9  0x0000556db51f9723 in Item::save_in_field_no_warnings (this=this@entry=0x1503fc0171d0, field=field@entry=0x1503fc1faa20, no_conversions=no_conversions@entry=true) at /test/11.3_dbg/sql/item.cc:1513
      #10 0x0000556db4d94398 in Field_temporal::get_mm_leaf (this=0x1503fc1faa20, prm=0x15043048fb30, key_part=0x1503fc04b160, cond=<optimized out>, op=SCALAR_CMP_LE, value=0x1503fc0171d0) at /test/11.3_dbg/sql/opt_range.cc:9246
      #11 0x0000556db4d851b1 in Item_bool_func::get_mm_leaf (this=0x1503fc016fa8, param=0x15043048fb30, field=0x1503fc1faa20, key_part=0x1503fc04b160, functype=Item_func::LE_FUNC, value=0x1503fc0171d0) at /test/11.3_dbg/sql/item_func.h:155
      #12 0x0000556db4d93adb in Item_bool_func::get_mm_parts (this=this@entry=0x1503fc016fa8, param=param@entry=0x15043048fb30, field=field@entry=0x1503fc1faa20, type=Item_func::LE_FUNC, value=value@entry=0x1503fc0171d0) at /test/11.3_dbg/sql/opt_range.cc:8958
      #13 0x0000556db52384a6 in Item_bool_func2_with_rev::get_func_mm_tree (this=0x1503fc016fa8, param=0x15043048fb30, field=0x1503fc1faa20, value=0x1503fc0171d0) at /test/11.3_dbg/sql/item_cmpfunc.h:513
      #14 0x0000556db4d98386 in Item_bool_func::get_full_func_mm_tree (this=this@entry=0x1503fc016fa8, param=param@entry=0x15043048fb30, field_item=field_item@entry=0x1503fc015608, value=value@entry=0x1503fc0171d0) at /test/11.3_dbg/sql/opt_range.cc:8617
      #15 0x0000556db4db0e2e in Item_bool_func::get_full_func_mm_tree_for_args (value=0x1503fc0171d0, item=<optimized out>, param=0x15043048fb30, this=0x1503fc016fa8) at /test/11.3_dbg/sql/item_cmpfunc.h:223
      #16 Item_bool_func2_with_rev::get_mm_tree (this=0x1503fc016fa8, param=0x15043048fb30, cond_ptr=<optimized out>) at /test/11.3_dbg/sql/item_cmpfunc.h:541
      #17 0x0000556db4da2c22 in SQL_SELECT::test_quick_select (this=this@entry=0x1503fc018198, thd=thd@entry=0x1503fc000d48, keys_to_use=..., prev_tables=prev_tables@entry=0, limit=limit@entry=18446744073709551615, force_quick_range=force_quick_range@entry=false, ordered_output=false, remove_false_parts_of_where=true, only_single_index_range_scan=false, note_unusable_keys=<optimized out>) at /test/11.3_dbg/sql/opt_range.cc:2944
      #18 0x0000556db4f3ad81 in get_quick_record_count (quick_count=<synthetic pointer>, limit=18446744073709551615, keys=0x1503fc0173e0, table=0x1503fc1fdc28, select=0x1503fc018198, thd=0x1503fc000d48) at /test/11.3_dbg/sql/sql_select.cc:5365
      #19 make_join_statistics (join=join@entry=0x1503fc016458, tables_list=..., keyuse_array=keyuse_array@entry=0x1503fc0167b8) at /test/11.3_dbg/sql/sql_select.cc:6142
      #20 0x0000556db4f42865 in JOIN::optimize_inner (this=this@entry=0x1503fc016458) at /test/11.3_dbg/sql/sql_select.cc:2657
      #21 0x0000556db4f42d11 in JOIN::optimize (this=this@entry=0x1503fc016458) at /test/11.3_dbg/sql/sql_select.cc:1966
      #22 0x0000556db4f42e31 in mysql_select (thd=thd@entry=0x1503fc000d48, tables=0x1503fc014ed8, fields=..., conds=0x1503fc015880, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2164525824, result=0x1503fc016430, unit=0x1503fc0051c8, select_lex=0x1503fc0148a8) at /test/11.3_dbg/sql/sql_select.cc:5290
      #23 0x0000556db4f436bb in handle_select (thd=thd@entry=0x1503fc000d48, lex=lex@entry=0x1503fc0050e8, result=result@entry=0x1503fc016430, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/11.3_dbg/sql/sql_select.cc:630
      #24 0x0000556db4ea2e74 in execute_sqlcom_select (thd=thd@entry=0x1503fc000d48, all_tables=0x1503fc014ed8) at /test/11.3_dbg/sql/sql_parse.cc:6077
      #25 0x0000556db4eaf96d in mysql_execute_command (thd=thd@entry=0x1503fc000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.3_dbg/sql/sql_parse.cc:3926
      #26 0x0000556db4e9cde4 in mysql_parse (thd=thd@entry=0x1503fc000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1504304912b0) at /test/11.3_dbg/sql/sql_parse.cc:7798
      #27 0x0000556db4eaaccc in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1503fc000d48, packet=packet@entry=0x1503fc116bf9 "SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23' ", packet_length=packet_length@entry=47, blocking=blocking@entry=true) at /test/11.3_dbg/sql/sql_class.h:1550
      #28 0x0000556db4ead3f8 in do_command (thd=0x1503fc000d48, blocking=blocking@entry=true) at /test/11.3_dbg/sql/sql_parse.cc:1406
      #29 0x0000556db5027fe9 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x556db7f6c1b8, put_in_cache=put_in_cache@entry=true) at /test/11.3_dbg/sql/sql_connect.cc:1417
      #30 0x0000556db502859e in handle_one_connection (arg=arg@entry=0x556db7f6c1b8) at /test/11.3_dbg/sql/sql_connect.cc:1319
      #31 0x0000556db54973b0 in pfs_spawn_thread (arg=0x556db7ee88e8) at /test/11.3_dbg/storage/perfschema/pfs.cc:2201
      #32 0x0000150437dc4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #33 0x00001504379b0133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        Issue Links

          Activity

            People

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