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

Assertion `option_struct' failed when truncating a table created with the example storage engine

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      INSTALL SONAME 'ha_example';
      CREATE TABLE t (a INT) ENGINE=example;
      TRUNCATE TABLE t;
       
      #Cleanup
      DROP TABLE t;
      

      Leads to:

      CS 13.0.0 d755574c47f101917aee29ea847e214c24c92c0b (Debug, Clang 18.1.3-11) Build 27/02/2026

      mariadbd: /test/12.3_dbg/storage/example/ha_example.cc:882: virtual int ha_example::create(const char *, TABLE *, HA_CREATE_INFO *): Assertion `option_struct' failed.
      

      CS 13.0.0 d755574c47f101917aee29ea847e214c24c92c0b (Debug, Clang 18.1.3-11) Build 27/02/2026

      Core was generated by `/test/MD270226-mariadb-13.0.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGABRT, Aborted.
      Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 4112090)]
      (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  0x0000717313a4527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x0000717313a288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x0000717313a2881b in __assert_fail_base (fmt=0x717313bd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7172e80b227f "option_struct", file=file@entry=0x7172e80b2252 "/test/12.3_dbg/storage/example/ha_example.cc", line=line@entry=882, function=function@entry=0x7172e80b22c3 "virtual int ha_example::create(const char *, TABLE *, HA_CREATE_INFO *)") at ./assert/assert.c:96
      #6  0x0000717313a3b517 in __assert_fail (assertion=0x7172e80b227f "option_struct", file=0x7172e80b2252 "/test/12.3_dbg/storage/example/ha_example.cc", line=882, function=0x7172e80b22c3 "virtual int ha_example::create(const char *, TABLE *, HA_CREATE_INFO *)") at ./assert/assert.c:105
      #7  0x00007172e80a7325 in ha_example::create (this=0x7171d404ab68, name=0x7172e8104d90 "./test/t", table_arg=0x7172e8103340, create_info=0x7172e8104fa0)at /test/12.3_dbg/storage/example/ha_example.cc:882
      #8  0x0000616b46e4e12f in handler::ha_create (this=0x7171d404ab68, name=0x7172e8104d90 "./test/t", form=0x7172e8103340, info_arg=0x7172e8104fa0) at /test/12.3_dbg/sql/handler.cc:6229
      #9  0x0000616b46e502e0 in ha_create_table_from_share (thd=0x7171d4000d58, share=0x7172e81046b0, create_info=0x7172e8104fa0, ref_length=0x7172e8103814) at /test/12.3_dbg/sql/handler.cc:6689
      #10 0x0000616b46e4fb2d in ha_create_table (thd=0x7171d4000d58, path=0x7172e8104d90 "./test/t", db=0x7171d401a1d0 "test", table_name=0x7171d401a1a0 "t", create_info=0x7172e8104fa0, frm=0x0, skip_frm_file=false) at /test/12.3_dbg/sql/handler.cc:6756
      #11 0x0000616b46c1b251 in dd_recreate_table (thd=0x7171d4000d58, db=0x7171d401a1d0 "test", table_name=0x7171d401a1a0 "t")at /test/12.3_dbg/sql/datadict.cc:211
      #12 0x0000616b46c19f24 in Sql_cmd_truncate_table::truncate_table (this=0x7171d401a930, thd=0x7171d4000d58, table_ref=0x7171d401a1e0)at /test/12.3_dbg/sql/sql_truncate.cc:520
      #13 0x0000616b46c1a1c1 in Sql_cmd_truncate_table::execute (this=0x7171d401a930, thd=0x7171d4000d58)at /test/12.3_dbg/sql/sql_truncate.cc:602
      #14 0x0000616b469f2322 in mysql_execute_command (thd=0x7171d4000d58, is_called_from_prepared_stmt=false) at /test/12.3_dbg/sql/sql_parse.cc:5898
      #15 0x0000616b469e15b4 in mysql_parse (thd=0x7171d4000d58, rawbuf=0x7171d401a120 "TRUNCATE TABLE t", length=16, parser_state=0x7172e8106ab0) at /test/12.3_dbg/sql/sql_parse.cc:7937
      #16 0x0000616b469de95d in dispatch_command (command=COM_QUERY, thd=0x7171d4000d58, packet=0x7171d400b4c9 "TRUNCATE TABLE t", packet_length=16, blocking=true) at /test/12.3_dbg/sql/sql_parse.cc:1896
      #17 0x0000616b469e2163 in do_command (thd=0x7171d4000d58, blocking=true)at /test/12.3_dbg/sql/sql_parse.cc:1432
      #18 0x0000616b46bdc999 in do_handle_one_connection (connect=0x616b88ca53a8, put_in_cache=true) at /test/12.3_dbg/sql/sql_connect.cc:1503
      #19 0x0000616b46bdc73e in handle_one_connection (arg=0x616b88c696a8)at /test/12.3_dbg/sql/sql_connect.cc:1415
      #20 0x0000717313a9caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #21 0x0000717313b29c6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.6   dbg  190226  8882f8fe6c5a87e2b367e260627af88ce9130d44  No bug found                  
      CS  10.6   opt  190226  8882f8fe6c5a87e2b367e260627af88ce9130d44  No bug found                  
      CS  10.11  dbg  270226  c84dfbd94d8cd21e473d416773e7cc3641fe488a  No bug found                  
      CS  10.11  opt  270226  c84dfbd94d8cd21e473d416773e7cc3641fe488a  No bug found                  
      CS  11.4   dbg  270226  a6e98760d9ded7803a752b9fb0a4b31ba6fb4c11  No bug found                  
      CS  11.4   opt  270226  a6e98760d9ded7803a752b9fb0a4b31ba6fb4c11  No bug found                  
      CS  11.8   dbg  190226  65ee9a7b4694d1b6f366b5a7a3d1b0549e5a3671  No bug found                  
      CS  11.8   opt  190226  65ee9a7b4694d1b6f366b5a7a3d1b0549e5a3671  No bug found                  
      CS  12.2   dbg  190226  d26a6f44c1f2119377e79a9540886c6d8c01472f  No bug found                  
      CS  12.2   opt  190226  d26a6f44c1f2119377e79a9540886c6d8c01472f  No bug found                  
      CS  12.3   dbg  190226  21a0714a118614982d20bfa504763d7247800091  No bug found                  
      CS  12.3   opt  190226  21a0714a118614982d20bfa504763d7247800091  No bug found                  
      CS  13.0   dbg  270226  d755574c47f101917aee29ea847e214c24c92c0b  option_struct|SIGABRT|ha_example::create|handler::ha_create|ha_create_table_from_share|ha_create_table
      CS  13.0   opt  270226  d755574c47f101917aee29ea847e214c24c92c0b  No bug found                  
      ES  10.6   dbg  151225  bc33b05c6a65de27dbe811a30bc37c207d60ee8e  No bug found                  
      ES  10.6   opt  151225  bc33b05c6a65de27dbe811a30bc37c207d60ee8e  No bug found                  
      ES  11.4   dbg  151225  714f2134597e00f4ff107886cf3a55eff48e4510  No bug found                  
      ES  11.4   opt  151225  714f2134597e00f4ff107886cf3a55eff48e4510  No bug found                  
      ES  11.8   dbg  151225  4008de1a5b06105a64821db7b851328f1b27d99e  No bug found                  
      ES  11.8   opt  151225  4008de1a5b06105a64821db7b851328f1b27d99e  No bug found                  
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.