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

SIGSEGV in process_i_s_table_temporary_tables after failed ALTER TABLE on temporary TIMESTAMP table with CHECK constraint

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.4, 11.8, 12.2(EOL), 12.3, 13.0
    • 11.4, 11.8, 12.3, 13.0
    • None
    • None
    • Can result in hang or crash

    Description

      Test case is mtr compatible:-

      CREATE TEMPORARY TABLE t (c INT KEY);
      ALTER TABLE t MODIFY c TIMESTAMP;
      ALTER TABLE t ADD CHECK(c=0);
      ALTER TABLE t ADD INDEX idx1 (c);
      SET SESSION sql_mode='TRADITIONAL';
       
      --error ER_WRONG_VALUE
      ALTER TABLE t ROW_FORMAT=COMPRESSED;
       
      --error ER_WRONG_VALUE
      ALTER TABLE t ANALYZE PARTITION p2;
       
      SELECT * FROM information_schema.tables;
      

      Leads to:

      CS 11.8.7 04e09010773caf0b302b2933fff3fe95381a5e13 (Optimized, Clang 18.1.3-11) Build 10/05/2026

      Core was generated by `/test/MD100526-mariadb-11.8.7-linux-x86_64-opt/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  process_i_s_table_temporary_tables (thd=0x75b188000c68, table=0x75b18802e3c0, tmp_tbl=0x0) at /test/11.8_opt/sql/sql_show.cc:6221
      6221	                           0, &tmp_tbl->s->db, &tmp_tbl->s->table_name);
      [Current thread is 1 (LWP 2529370)]
      (gdb) bt
      #0  process_i_s_table_temporary_tables (thd=0x75b188000c68, table=0x75b18802e3c0, tmp_tbl=0x0) at /test/11.8_opt/sql/sql_show.cc:6221
      #1  get_all_tables (thd=0x75b188000c68, tables=0x75b188017bf0, cond=<optimized out>) at /test/11.8_opt/sql/sql_show.cc:5595
      #2  0x000064befeef6051 in get_schema_tables_result (join=join@entry=0x75b1880197f8, executed_place=executed_place@entry=PROCESSED_BY_JOIN_EXEC)at /test/11.8_opt/sql/sql_show.cc:9771
      #3  0x000064befeeb6335 in JOIN::exec_inner (this=this@entry=0x75b1880197f8)at /test/11.8_opt/sql/sql_select.cc:5073
      #4  0x000064befee9d1b0 in JOIN::exec (this=0x75b1880197f8)at /test/11.8_opt/sql/sql_select.cc:4900
      #5  mysql_select (thd=thd@entry=0x75b188000c68, tables=<optimized out>, fields=@0x75b188017840: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x75b188017b70, last = 0x75b18801bf38, elements = 23}, <No data fields>}, conds=<optimized out>, og_num=<optimized out>, order=<optimized out>, group=0x0, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x75b1880197d0, unit=0x75b188004fe8, select_lex=0x75b188017588)at /test/11.8_opt/sql/sql_select.cc:5426
      #6  0x000064befee9ce39 in handle_select (thd=thd@entry=0x75b188000c68, lex=lex@entry=0x75b188004f08, result=result@entry=0x75b1880197d0, setup_tables_done_option=setup_tables_done_option@entry=0)at /test/11.8_opt/sql/sql_select.cc:634
      #7  0x000064befee6cc34 in execute_sqlcom_select (thd=thd@entry=0x75b188000c68, all_tables=0x75b188017bf0) at /test/11.8_opt/sql/sql_parse.cc:6234
      #8  0x000064befee680e0 in mysql_execute_command (thd=thd@entry=0x75b188000c68, is_called_from_prepared_stmt=false) at /test/11.8_opt/sql/sql_parse.cc:4016
      #9  0x000064befee63a12 in mysql_parse (thd=thd@entry=0x75b188000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7db285afc4f0)at /test/11.8_opt/sql/sql_parse.cc:7955
      #10 0x000064befee61ecf in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x75b188000c68, packet=packet@entry=0x75b188008889 "SELECT * FROM information_schema.tables", packet_length=packet_length@entry=39, blocking=true)at /test/11.8_opt/sql/sql_parse.cc:1923
      #11 0x000064befee63e91 in do_command (thd=thd@entry=0x75b188000c68, blocking=true) at /test/11.8_opt/sql/sql_parse.cc:1431
      #12 0x000064befef8463d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x64bf303a69c8, put_in_cache=true)at /test/11.8_opt/sql/sql_connect.cc:1504
      #13 0x000064befef84472 in handle_one_connection (arg=arg@entry=0x64bf303a69c8)at /test/11.8_opt/sql/sql_connect.cc:1416
      #14 0x000064beff2ebb63 in pfs_spawn_thread (arg=0x64bf303a6a38)at /test/11.8_opt/storage/perfschema/pfs.cc:2198
      #15 0x00007db288c9caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #16 0x00007db288d29c6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      CS 11.8.7 04e09010773caf0b302b2933fff3fe95381a5e13 (Debug, Clang 18.1.3-11) Build 10/05/2026

      Core was generated by `/test/MD100526-mariadb-11.8.7-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x00005a8994794779 in process_i_s_table_temporary_tables (thd=0x6eda9c000d58, table=0x6eda9c033560, tmp_tbl=0x0)at /test/11.8_dbg/sql/sql_show.cc:6221
      6221	                           0, &tmp_tbl->s->db, &tmp_tbl->s->table_name);
      [Current thread is 1 (LWP 2529214)]
      (gdb) bt
      #0  0x00005a8994794779 in process_i_s_table_temporary_tables (thd=0x6eda9c000d58, table=0x6eda9c033560, tmp_tbl=0x0)at /test/11.8_dbg/sql/sql_show.cc:6221
      #1  0x00005a899479325b in get_all_tables (thd=0x6eda9c000d58, tables=0x6eda9c01a3e0, cond=0x0) at /test/11.8_dbg/sql/sql_show.cc:5595
      #2  0x00005a89947a09fa in get_schema_tables_result (join=0x6eda9c01bfe8, executed_place=PROCESSED_BY_JOIN_EXEC)at /test/11.8_dbg/sql/sql_show.cc:9771
      #3  0x00005a899473a6f8 in JOIN::exec_inner (this=0x6eda9c01bfe8)at /test/11.8_dbg/sql/sql_select.cc:5073
      #4  0x00005a8994739bb0 in JOIN::exec (this=0x6eda9c01bfe8)at /test/11.8_dbg/sql/sql_select.cc:4900
      #5  0x00005a899471467c in mysql_select (thd=0x6eda9c000d58, tables=0x6eda9c01a3e0, fields=@0x6eda9c01a030: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x6eda9c01a360, last = 0x6eda9c01e738, elements = 23}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2701396736, result=0x6eda9c01bfc0, unit=0x6eda9c0050a8, select_lex=0x6eda9c019d78) at /test/11.8_dbg/sql/sql_select.cc:5426
      #6  0x00005a89947140f5 in handle_select (thd=0x6eda9c000d58, lex=0x6eda9c004fc8, result=0x6eda9c01bfc0, setup_tables_done_option=0)at /test/11.8_dbg/sql/sql_select.cc:634
      #7  0x00005a89946baa51 in execute_sqlcom_select (thd=0x6eda9c000d58, all_tables=0x6eda9c01a3e0) at /test/11.8_dbg/sql/sql_parse.cc:6234
      #8  0x00005a89946af932 in mysql_execute_command (thd=0x6eda9c000d58, is_called_from_prepared_stmt=false) at /test/11.8_dbg/sql/sql_parse.cc:4016
      #9  0x00005a89946a7964 in mysql_parse (thd=0x6eda9c000d58, rawbuf=0x6eda9c019cd0 "SELECT * FROM information_schema.tables", length=39, parser_state=0x76db94197a10)at /test/11.8_dbg/sql/sql_parse.cc:7955
      #10 0x00005a89946a4ca9 in dispatch_command (command=COM_QUERY, thd=0x6eda9c000d58, packet=0x6eda9c00b079 "SELECT * FROM information_schema.tables", packet_length=39, blocking=true) at /test/11.8_dbg/sql/sql_parse.cc:1923
      #11 0x00005a89946a8513 in do_command (thd=0x6eda9c000d58, blocking=true)at /test/11.8_dbg/sql/sql_parse.cc:1431
      #12 0x00005a8994895df9 in do_handle_one_connection (connect=0x5a89c93aaf08, put_in_cache=true) at /test/11.8_dbg/sql/sql_connect.cc:1504
      #13 0x00005a8994895b9e in handle_one_connection (arg=0x5a89c946b7b8)at /test/11.8_dbg/sql/sql_connect.cc:1416
      #14 0x000076dbbaa9caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #15 0x000076dbbab29c6c 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  100526  d37e50c6d04c7c27362f1668ae86fa592b94fb23  No bug found                  
      CS  10.6   opt  100526  d37e50c6d04c7c27362f1668ae86fa592b94fb23  No bug found                  
      CS  10.11  dbg  100526  8721a00dd38dc0aa1514a3b5ca8c95c6e94af1c9  No bug found                  
      CS  10.11  opt  100526  8721a00dd38dc0aa1514a3b5ca8c95c6e94af1c9  No bug found                  
      CS  11.4   dbg  100526  f279551013d1319f27344080e2c0758f3959cebf  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      CS  11.4   opt  100526  f279551013d1319f27344080e2c0758f3959cebf  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      CS  11.8   dbg  100526  04e09010773caf0b302b2933fff3fe95381a5e13  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      CS  11.8   opt  100526  04e09010773caf0b302b2933fff3fe95381a5e13  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      CS  12.2   dbg  140526  d26a6f44c1f2119377e79a9540886c6d8c01472f  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      CS  12.2   opt  140526  d26a6f44c1f2119377e79a9540886c6d8c01472f  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      CS  12.3   dbg  100526  4c371e30f003b601e7485533476208ae27d51937  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      CS  12.3   dbg  110526  c0849d98f7ca2627ea90283b125b5b86f75b173a  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      CS  12.3   opt  100526  4c371e30f003b601e7485533476208ae27d51937  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      CS  12.3   opt  110526  c0849d98f7ca2627ea90283b125b5b86f75b173a  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      CS  13.0   dbg  100526  96b3dd0c34427e9338dda1375575a0e05a7cd267  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      CS  13.0   opt  100526  96b3dd0c34427e9338dda1375575a0e05a7cd267  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      ES  10.6   dbg  100526  55cfada6c54d1b08f2372adc1369a5e5e76f472d  No bug found                  
      ES  10.6   opt  100526  55cfada6c54d1b08f2372adc1369a5e5e76f472d  No bug found                  
      ES  11.4   dbg  100526  90f707057d44f1b5c013a0c3672fd12f32ea7085  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      ES  11.4   opt  100526  90f707057d44f1b5c013a0c3672fd12f32ea7085  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      ES  11.8   dbg  100526  d4fbd664a4514441bb3d9042c0089842ee6fc3c8  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      ES  11.8   opt  100526  d4fbd664a4514441bb3d9042c0089842ee6fc3c8  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      ES  12.3   dbg  100526  4063148254974421994024b7cc94f6f2a850177d  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      ES  12.3   opt  100526  4063148254974421994024b7cc94f6f2a850177d  SIGSEGV|process_i_s_table_temporary_tables|get_all_tables|get_schema_tables_result|JOIN::exec_inner
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            saahil Saahil Alam
            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.