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

Assertion `table->no_keyread || !table->covering_keys.is_set(tab->index) || table->file->keyread == tab->index' failed

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • N/A
    • Optimizer
    • None
    • Can result in hang or crash
    • Q2/2026 Server Development

    Description

      Server Crash seen while testing MDEV-39014

      Issue:

      ---------
      mariadbd: /home/ppandith/wl-39014/sql/sql_select.cc:26928: int join_read_first(JOIN_TAB*): Assertion `table->no_keyread || !table->covering_keys.is_set(tab->index) || table->file->keyread == tab->index' failed.
      260515 12:23:58 [ERROR] ./sql/mariadbd got signal 6 ;

      Version:

      ----------------
      Branch : 13.2-mdev-39014-full-join-p2
      commit : e02d2addeff44108d448976b9ec3127251210095
      Version : 13.0.1

      How to Repro:

      ---------------

      source dump1.sql 
      SELECT ( SELECT MIN( C.`pk` ) FROM ( C FULL JOIN D AS alias2 ON (alias2.`pk` IN ( SELECT D.`col_int_nokey` FROM D) ) ) WHERE alias2.`pk` = D.`pk` OR C.`col_varchar_nokey` = C.`col_varchar_key`) AS field1 FROM D;
      

      Stack trace:

      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:89
      #3  my_write_core (sig=6) at /home/ppandith/wl-39014/mysys/stacktrace.c:424
      #4  handle_fatal_signal (sig=6) at /home/ppandith/wl-39014/sql/signal_handler.cc:298
      #5  <signal handler called>
      #6  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
      #7  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
      #8  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
      #9  __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      #10 __GI_abort () at ./stdlib/abort.c:79
      #11 __assert_fail_base (fmt="%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
          assertion=assertion@entry="table->no_keyread || !table->covering_keys.is_set(tab->index) || table->file->keyread == tab->index", 
          file=file@entry="/home/ppandith/wl-39014/sql/sql_select.cc", line=line@entry=26928, 
          function=function@entry="int join_read_first(JOIN_TAB*)") at ./assert/assert.c:96
      #12 __assert_fail (assertion="table->no_keyread || !table->covering_keys.is_set(tab->index) || table->file->keyread == tab->index", 
          file="/home/ppandith/wl-39014/sql/sql_select.cc", line=26928, function="int join_read_first(JOIN_TAB*)") at ./assert/assert.c:105
      #13 join_read_first (tab=) at /home/ppandith/wl-39014/sql/sql_select.cc:26928
      #14 sub_select (join=, join_tab=, end_of_records=false) at /home/ppandith/wl-39014/sql/sql_select.cc:25688
      #15 evaluate_join_record (join=, join_tab=, error=0) at /home/ppandith/wl-39014/sql/sql_select.cc:26043
      #16 sub_select (join=, join_tab=, end_of_records=false) at /home/ppandith/wl-39014/sql/sql_select.cc:25691
      #17 do_select (join=, procedure=) at /home/ppandith/wl-39014/sql/sql_select.cc:25107
      #18 JOIN::exec_inner (this=) at /home/ppandith/wl-39014/sql/sql_select.cc:5244
      #19 JOIN::exec (this=) at /home/ppandith/wl-39014/sql/sql_select.cc:5032
      #20 subselect_single_select_engine::exec (this=) at /home/ppandith/wl-39014/sql/item_subselect.cc:4201
      #21 Item_subselect::exec (this=) at /home/ppandith/wl-39014/sql/item_subselect.cc:813
      #22 Item_singlerow_subselect::val_int (this=) at /home/ppandith/wl-39014/sql/item_subselect.cc:1481
      #23 Item::val_int_result (this=) at /home/ppandith/wl-39014/sql/item.h:1829
      #24 Item_cache_int::cache_value (this=) at /home/ppandith/wl-39014/sql/item.cc:10940
      #25 Item_cache_wrapper::cache (this=) at /home/ppandith/wl-39014/sql/item.cc:9441
      #26 Item_cache_wrapper::val_int (this=) at /home/ppandith/wl-39014/sql/item.cc:9495
      #27 Type_handler::Item_send_long (this=<type_handler_slong>, item=, protocol=, buf=) at /home/ppandith/wl-39014/sql/sql_type.cc:7697
      #28 Type_handler_long::Item_send (this=<type_handler_slong>, item=, protocol=, buf=) at /home/ppandith/wl-39014/sql/sql_type.h:5953
      #29 Item::send (this=, protocol=, buffer=) at /home/ppandith/wl-39014/sql/item.h:1243
      #30 Item_cache_wrapper::send (this=, protocol=, buffer=) at /home/ppandith/wl-39014/sql/item.cc:9347
      #31 Protocol::send_result_set_row (this=, row_items=) at /home/ppandith/wl-39014/sql/protocol.cc:1358
      #32 select_send::send_data (this=, items=...) at /home/ppandith/wl-39014/sql/sql_class.cc:3410
      #33 select_result_sink::send_data_with_check (this=, items=..., u=, sent=1) at /home/ppandith/wl-39014/sql/sql_class.cc:3308
      #34 end_send (join=, join_tab=, end_of_records=false) at /home/ppandith/wl-39014/sql/sql_select.cc:27169
      #35 evaluate_join_record (join=, join_tab=, error=0) at /home/ppandith/wl-39014/sql/sql_select.cc:26043
      #36 sub_select (join=, join_tab=, end_of_records=false) at /home/ppandith/wl-39014/sql/sql_select.cc:25728
      #37 do_select (join=, procedure=) at /home/ppandith/wl-39014/sql/sql_select.cc:25107
      #38 JOIN::exec_inner (this=) at /home/ppandith/wl-39014/sql/sql_select.cc:5244
      #39 JOIN::exec (this=) at /home/ppandith/wl-39014/sql/sql_select.cc:5032
      #40 mysql_select (thd=, tables=, fields=..., conds=, og_num=0, order=, group=, having=, proc_param=, select_options=2164525824, 
          result=, unit=, select_lex=) at /home/ppandith/wl-39014/sql/sql_select.cc:5558
      #41 handle_select (thd=, lex=, result=, setup_tables_done_option=0) at /home/ppandith/wl-39014/sql/sql_select.cc:752
      #42 execute_sqlcom_select (thd=, all_tables=) at /home/ppandith/wl-39014/sql/sql_parse.cc:6213
      #43 mysql_execute_command (thd=, is_called_from_prepared_stmt=false) at /home/ppandith/wl-39014/sql/sql_parse.cc:3989
      #44 mysql_parse (thd=, 
          rawbuf="SELECT ( SELECT MIN( C.`pk` ) FROM ( C FULL JOIN D AS alias2 ON (alias2.`pk` IN ( SELECT D.`col_int_nokey` FROM D) ) ) WHERE alias2.`pk` = D.`pk` OR C.`col_varchar_nokey` = C.`col_varchar_key`) AS fie"..., length=210, parser_state=)
          at /home/ppandith/wl-39014/sql/sql_parse.cc:7941
      #45 dispatch_command (command=COM_QUERY, thd=, packet="", packet_length=210, blocking=true)
          at /home/ppandith/wl-39014/sql/sql_parse.cc:1898
      #46 do_command (thd=, blocking=true) at /home/ppandith/wl-39014/sql/sql_parse.cc:1432
      #47 do_handle_one_connection (connect=, put_in_cache=true) at /home/ppandith/wl-39014/sql/sql_connect.cc:1503
      #48 handle_one_connection (arg=) at /home/ppandith/wl-39014/sql/sql_connect.cc:1415
      #49 pfs_spawn_thread (arg=) at /home/ppandith/wl-39014/storage/perfschema/pfs.cc:2198
      #50 start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
      #51 clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

        Issue Links

          Activity

            People

              Gosselin Dave Gosselin
              mariadb-pavithrapandith Pavithra Pandith
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.5d
                  0.5d

                  Git Integration

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