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

Assertion `select_lex->hidden_bit_fields == 0' failed

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      CREATE TABLE t (b BIT);
      UPDATE t SET b = 1 RETURNING *;
      

      Leads to:

      CS 13.0.2 be111d2cd60d035d555b71da019765cfb42ea0d3 (Debug, Clang 22.1.8-20260621) Build 21/08/2026

      mariadbd: /test/13.0_dbg/sql/sql_select.cc:1547: int JOIN::prepare(TABLE_LIST *, COND *, uint, ORDER *, bool, ORDER *, Item *, ORDER *, SELECT_LEX *, SELECT_LEX_UNIT *): Assertion `select_lex->hidden_bit_fields == 0' failed.
      

      CS 13.0.2 be111d2cd60d035d555b71da019765cfb42ea0d3 (Debug, Clang 22.1.8-20260621) Build 21/08/2026

      Core was generated by `/test/MD210826-mariadb-13.0.2-linux-x86_64-dbg/bin/mariadbd --no-defaults --loo'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 1590209)]
      (gdb) bt
      #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=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x0000701c6244527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x0000701c624288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x0000701c6242881b in __assert_fail_base (fmt=0x701c625d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5d3849f05819 "select_lex->hidden_bit_fields == 0", file=file@entry=0x5d3849f05663 "/test/13.0_dbg/sql/sql_select.cc", line=line@entry=1547, function=function@entry=0x5d3849f0583c "int JOIN::prepare(TABLE_LIST *, COND *, uint, ORDER *, bool, ORDER *, Item *, ORDER *, SELECT_LEX *, SELECT_LEX_UNIT *)") at ./assert/assert.c:96
      #6  0x0000701c6243b517 in __assert_fail (assertion=0x5d3849f05819 "select_lex->hidden_bit_fields == 0", file=0x5d3849f05663 "/test/13.0_dbg/sql/sql_select.cc", line=1547, function=0x5d3849f0583c "int JOIN::prepare(TABLE_LIST *, COND *, uint, ORDER *, bool, ORDER *, Item *, ORDER *, SELECT_LEX *, SELECT_LEX_UNIT *)")at ./assert/assert.c:105
      #7  0x00005d3848f7f288 in JOIN::prepare (this=0x681b6801b420, tables_init=0x681b6801a4d0, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x681b68005b00, unit_arg=0x681b68005280)at /test/13.0_dbg/sql/sql_select.cc:1547
      #8  0x00005d3849073dc0 in Sql_cmd_update::prepare_inner (this=0x681b6801ae30, thd=0x681b68000d60) at /test/13.0_dbg/sql/sql_update.cc:3207
      #9  0x00005d3848fce014 in Sql_cmd_dml::prepare (this=0x681b6801ae30, thd=0x681b68000d60) at /test/13.0_dbg/sql/sql_select.cc:34927
      #10 0x00005d3848fce1eb in Sql_cmd_dml::execute (this=0x681b6801ae30, thd=0x681b68000d60) at /test/13.0_dbg/sql/sql_select.cc:34983
      #11 0x00005d3848f1da00 in mysql_execute_command (thd=0x681b68000d60, is_called_from_prepared_stmt=false) at /test/13.0_dbg/sql/sql_parse.cc:4446
      #12 0x00005d3848f14d18 in mysql_parse (thd=0x681b68000d60, rawbuf=0x681b6801a3c0 "UPDATE t SET b = 1 RETURNING *", length=30, parser_state=0x701c602059f0) at /test/13.0_dbg/sql/sql_parse.cc:7943
      #13 0x00005d3848f1246e in dispatch_command (command=COM_QUERY, thd=0x681b68000d60, packet=0x681b6800b5f1 "UPDATE t SET b = 1 RETURNING *", packet_length=30, blocking=true) at /test/13.0_dbg/sql/sql_parse.cc:1903
      #14 0x00005d3848f1579a in do_command (thd=0x681b68000d60, blocking=true)at /test/13.0_dbg/sql/sql_parse.cc:1437
      #15 0x00005d38490e775e in do_handle_one_connection (connect=0x5d3886ecc880, put_in_cache=true) at /test/13.0_dbg/sql/sql_connect.cc:1514
      #16 0x00005d38490e7541 in handle_one_connection (arg=0x5d3886eab1e0)at /test/13.0_dbg/sql/sql_connect.cc:1426
      #17 0x0000701c6249cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #18 0x0000701c62529d6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.11  dbg  210826  6415902490b1b0a9a500cee9bc0a41c342190605  No bug found                  
      CS  10.11  opt  210826  6415902490b1b0a9a500cee9bc0a41c342190605  No bug found                  
      CS  11.4   dbg  210826  1a052f27e374fc9b4cb5b1fd098cf10f0e1381cc  No bug found                  
      CS  11.4   opt  210826  1a052f27e374fc9b4cb5b1fd098cf10f0e1381cc  No bug found                  
      CS  11.8   dbg  210826  d26f9ab217a7fcf9d4eccc62c01020ff275ff42e  No bug found                  
      CS  11.8   opt  210826  d26f9ab217a7fcf9d4eccc62c01020ff275ff42e  No bug found                  
      CS  12.3   dbg  210826  add63991988734383c5e942de2a19c6c45f511f7  No bug found                  
      CS  12.3   opt  210826  add63991988734383c5e942de2a19c6c45f511f7  No bug found                  
      CS  13.0   dbg  210826  be111d2cd60d035d555b71da019765cfb42ea0d3  select_lex->hidden_bit_fields == 0|SIGABRT|JOIN::prepare|Sql_cmd_update::prepare_inner|Sql_cmd_dml::prepare|Sql_cmd_dml::execute
      CS  13.0   opt  210826  be111d2cd60d035d555b71da019765cfb42ea0d3  No bug found                  
      CS  13.1   dbg  210826  ff09eefbe4e8b57846435ee4a928f17e49f0fdfc  select_lex->hidden_bit_fields == 0|SIGABRT|JOIN::prepare|Sql_cmd_update::prepare_inner|Sql_cmd_dml::prepare|Sql_cmd_dml::execute
      CS  13.1   opt  210826  ff09eefbe4e8b57846435ee4a928f17e49f0fdfc  No bug found                  
      ES  10.6   dbg  210826  fcecb2620f25965723d640decede7c018bcb1dcc  No bug found                  
      ES  10.6   opt  210826  fcecb2620f25965723d640decede7c018bcb1dcc  No bug found                  
      ES  11.4   dbg  210826  3b34189bfe675c18c4ced3ef531d016ea74c76f4  No bug found                  
      ES  11.4   opt  210826  3b34189bfe675c18c4ced3ef531d016ea74c76f4  No bug found                  
      ES  11.8   dbg  210826  4694e931d10fecf733c34f83ea2146d31b708eb3  No bug found                  
      ES  11.8   opt  210826  4694e931d10fecf733c34f83ea2146d31b708eb3  No bug found                  
      ES  12.3   dbg  210826  f513f503feacabfb219d4a6f965b5f72b86d4db0  No bug found                  
      ES  12.3   opt  210826  f513f503feacabfb219d4a6f965b5f72b86d4db0  No bug found                  
      

      Attachments

        Activity

          People

            rucha174 Rucha Deodhar
            saahil Saahil Alam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

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

                Git Integration

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