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

MariaDB debug build assertion `maybe_null() || !null_value' failed in Item_func_round::time_op

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 12.2.2
    • N/A
    • Optimizer
    • None
    • ubuntu 22.04
    • Not for Release Notes

    Description

      MariaDB debug build (12.2.2-MariaDB-asan-debug) crashes with an assertion failure when using ROUND function on CURRENT_TIME result in a CTE. The assertion `maybe_null() || !null_value` fails in `Item_func_round::time_op()`.

      DROP DATABASE IF EXISTS sqlcraft;
      CREATE DATABASE sqlcraft;
      USE sqlcraft;
      CREATE OR REPLACE TABLE t0(c0 REAL  UNIQUE);
       
      WITH  tom5 AS ( SELECT CURRENT_TIME( 0 ) AS c3 WHERE ( b'101010' ) >>  ( EXTRACT( YEAR FROM '2025-12-31' ) )  ) 
      SELECT 1 AS c9 FROM tom5 AS tom16 WHERE ROUND( tom16.c3 , 9 );
      

      crash logs:
       
      mariadbd: /app/dbms/mariadb-12.2.2/sql/item_func.cc:2817: virtual bool Item_func_round::time_op(THD*, MYSQL_TIME*): Assertion `maybe_null() || !null_value' failed.
      260420  9:52:37 [ERROR] /usr/local/mariadb-asan/bin/mariadbd got signal 6 ;
      Sorry, we probably made a mistake, and this is a bug.
       
      Your assistance in bug reporting will enable us to fix this for the next release.
      To report this bug, see https://mariadb.com/kb/en/reporting-bugs about how to report
      a bug on https://jira.mariadb.org/.
       
      Please include the information from the server start above, to the end of the
      information below.
       
      Server version: 12.2.2-MariaDB-asan-debug source revision: d26a6f44c1f2119377e79a9540886c6d8c01472f
       
      The information page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mariadbd/
      contains instructions to obtain a better version of the backtrace below.
      Following these instructions will help MariaDB developers provide a fix quicker.
       
      Attempting backtrace. Include this in the bug report.
      (note: Retrieving this information may fail)
       
      Thread pointer: 0x52c0001c0218
      stack_bottom = 0x7bc703850000 thread_stack 0xb00000
      sanitizer_common/sanitizer_common_interceptors.inc:4193(__interceptor_backtrace.part.0)[0x7bc72b845c0e]
      mysys/stacktrace.c:215(my_print_stacktrace)[0x55c4c18551b6]
      sql/signal_handler.cc:230(handle_fatal_signal)[0x55c4c003bb58]
      libc_sigaction.c:0(__restore_rt)[0x7bc72aa42520]
      nptl/pthread_kill.c:44(__pthread_kill_implementation)[0x7bc72aa969fc]
      posix/raise.c:27(__GI_raise)[0x7bc72aa42476]
      stdlib/abort.c:81(__GI_abort)[0x7bc72aa287f3]
      intl/loadmsgcat.c:1177(_nl_load_domain)[0x7bc72aa2871b]
      /lib/x86_64-linux-gnu/libc.so.6(+0x39e96)[0x7bc72aa39e96]
      sql/item_func.cc:2818(Item_func_round::time_op(THD*, st_mysql_time*))[0x55c4c01d1929]
      sql/item_func.h:954(Item_func_hybrid_field_type::time_op_with_null_check(THD*, st_mysql_time*))[0x55c4c02032c0]
      sql/item_func.cc:989(Item_func_hybrid_field_type::val_real_from_time_op())[0x55c4c01b9d50]
      sql/sql_type.cc:5772(Type_handler_time_common::Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type*) const)[0x55c4bfd9aa88]
      sql/item_func.h:1024(Item_func_hybrid_field_type::val_real())[0x55c4bf5cd4ce]
      sql/sql_type.cc:5266(Type_handler_temporal_result::Item_val_bool(Item*) const)[0x55c4bfd96cde]
      /usr/local/mariadb-asan/bin/mariadbd(+0x1db196a)[0x55c4bf2a696a]
      sql/item.h:1707(Item::val_bool())[0x55c4bf81fae2]
      sql/item.h:1731(Item::eval_const_cond())[0x55c4bf7af16f]
      sql/sql_select.cc:21297(Item::remove_eq_conds(THD*, Item::cond_result*, bool))[0x55c4bf74903f]
      sql/sql_select.cc:6117(make_join_statistics(JOIN*, List<TABLE_LIST>&, st_dynamic_array*))[0x55c4bf7272f5]
      sql/sql_select.cc:2768(JOIN::optimize_inner())[0x55c4bf71f57a]
      sql/sql_select.cc:2021(JOIN::optimize())[0x55c4bf742b8c]
      sql/sql_select.cc:5430(mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x55c4bf7101ad]
      sql/sql_select.cc:636(handle_select(THD*, LEX*, select_result*, unsigned long long))[0x55c4bf6276cd]
      sql/sql_parse.cc:6203(execute_sqlcom_select(THD*, TABLE_LIST*))[0x55c4bf6172cf]
      sql/sql_parse.cc:3985(mysql_execute_command(THD*, bool))[0x55c4bf632707]
      sql/sql_parse.cc:1898(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x55c4bf608c04]
      sql/sql_parse.cc:1432(do_command(THD*, bool))[0x55c4bf60589c]
      sql/sql_connect.cc:1503(do_handle_one_connection(CONNECT*, bool))[0x55c4bfb30ad9]
      sql/sql_connect.cc:1417(handle_one_connection)[0x55c4bfb3062c]
      perfschema/pfs.cc:2200(pfs_spawn_thread)[0x55c4c09e8b0a]
      nptl/pthread_create.c:442(start_thread)[0x7bc72aa94ac3]
      x86_64/clone3.S:83(__clone3)[0x7bc72ab268d0]
       
      Connection ID (thread ID): 3
      Status: NOT_KILLED
      Query (0x52d00024e438): WITH  tom5 AS ( SELECT CURRENT_TIME( 0 ) AS c3 WHERE ( b'101010' ) >>  ( EXTRACT( YEAR FROM '2025-12-31' ) )  ) 
       SELECT 1 AS c9 FROM tom5 AS tom16 WHERE ROUND( tom16.c3 , 9 )
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ammmkilo ammmkilo
              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.