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

Fatal error InnoDB: Clustered record field for column x not found

    XMLWordPrintable

Details

    Description

      I have a schema where a virtual column is used in an unique index. It worked with version 10.3.39 on debian buster.

      CREATE TABLE `idp` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `name` varchar(64) NOT NULL,
        `type` varchar(64) NOT NULL,
        PRIMARY KEY (`id`),
        UNIQUE KEY `uq_idp_name` (`name`)
      );
      CREATE TABLE `user` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `username` varchar(64) NOT NULL,
        `name` text DEFAULT NULL,
        `password` varchar(255) DEFAULT NULL,
        `must_change_password` tinyint(1) NOT NULL,
        `email` text DEFAULT NULL,
        `scope` text NOT NULL,
        `idp_id` int(11) DEFAULT NULL,
        `idp_refreshed` int(11) DEFAULT NULL,
        `disabled` tinyint(1) NOT NULL,
        `service` tinyint(1) NOT NULL,
        `_idp_id` int(11) GENERATED ALWAYS AS (coalesce(`idp_id`,0)) VIRTUAL,
        PRIMARY KEY (`id`),
        UNIQUE KEY `uq_user_username` (`username`,`_idp_id`),
        KEY `fk_user_idp_id_idp` (`idp_id`),
        CONSTRAINT `fk_user_idp_id_idp` FOREIGN KEY (`idp_id`) REFERENCES `idp` (`id`) ON DELETE CASCADE
      );
      

      2024-02-22 11:33:52 34 [Note] InnoDB: Looking for field 11 name DB_ROW_ID from table `bert`.`user`
      2024-02-22 11:33:52 34 [Note] InnoDB: InnoDB Table `bert`.`user`field 0 name id
      2024-02-22 11:33:52 34 [Note] InnoDB: MySQL table user field 0 name id
      2024-02-22 11:33:52 34 [Note] InnoDB: MySQL table user field 1 name username
      2024-02-22 11:33:52 34 [Note] InnoDB: MySQL table user field 2 name name
      2024-02-22 11:33:52 34 [Note] InnoDB: MySQL table user field 3 name password
      2024-02-22 11:33:52 34 [Note] InnoDB: MySQL table user field 4 name must_change_password
      2024-02-22 11:33:52 34 [Note] InnoDB: MySQL table user field 5 name email
      2024-02-22 11:33:52 34 [Note] InnoDB: MySQL table user field 6 name scope
      2024-02-22 11:33:52 34 [Note] InnoDB: MySQL table user field 7 name idp_id
      2024-02-22 11:33:52 34 [Note] InnoDB: MySQL table user field 8 name _idp_id
      2024-02-22 11:33:52 34 [Note] InnoDB: MySQL table user field 9 name idp_refreshed
      2024-02-22 11:33:52 34 [Note] InnoDB: MySQL table user field 10 name disabled
      2024-02-22 11:33:52 34 [ERROR] [FATAL] InnoDB: Clustered record field for column 11 not found table n_user_defined 1 index n_user_defined 11 InnoDB table `bert`.`user` field name NULL MySQL table user field name DB_ROW_ID n_fields 11 query SELECT user.id AS user_id, user.username AS user_username, user.name AS user_name, user.password AS user_password, user.must_change_password AS user_must_change_password, user.email AS user_email, user.scope AS user_scope, user.idp_id AS user_idp_id, user._idp_id AS user__idp_id, user.idp_refreshed AS user_idp_refreshed, user.disabled AS user_disabled, user.service AS user_service
      FROM user
      WHERE user.username = 'user1' AND user.idp_id = 1
       LIMIT 1 FOR UPDATE
      240222 11:33:52 [ERROR] mysqld 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
      We will try our best to scrape up some info that will hopefully help
      diagnose the problem, but since we have already crashed,
      something is definitely wrong and this may fail.
      Server version: 10.11.6-MariaDB-0+deb12u1 source revision:
      key_buffer_size=134217728
      read_buffer_size=131072
      max_used_connections=4
      max_threads=153
      thread_count=4
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 468057 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
      Thread pointer: 0x7fa1c4001768
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 0x7fa1cc51cc78 thread_stack 0x49000
      mysys/stacktrace.c:216(my_print_stacktrace)[0x558d7a02126e]
      sql/signal_handler.cc:238(handle_fatal_signal)[0x558d79b91593]
      /lib/x86_64-linux-gnu/libc.so.6(+0x3c050)[0x7fa1ed639050]
      /lib/x86_64-linux-gnu/libc.so.6(+0x8ae2c)[0x7fa1ed687e2c]
      /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x12)[0x7fa1ed638fb2]
      /lib/x86_64-linux-gnu/libc.so.6(abort+0xd3)[0x7fa1ed623472]
      ut/ut0ut.cc:527(ib::fatal::~fatal() [clone .cold])[0x558d797f54b5]
      handler/ha_innodb.cc:7182(build_template_field(row_prebuilt_t*, dict_index_t*, dict_index_t*, TABLE*, Field const*, unsigned long, unsigned long) [clone .cold])[0x558d797d40ac]
      handler/ha_innodb.cc:7581(ha_innobase::build_template(bool))[0x558d79e35279]
      handler/ha_innodb.cc:9273(ha_innobase::change_active_index(unsigned int))[0x558d79e35990]
      sql/handler.h:3390(handler::ha_index_init(unsigned int, bool))[0x558d799b7608]
      sql/sql_select.cc:22265(sub_select(JOIN*, st_join_table*, bool))[0x558d799a2206]
      sql/sql_select.cc:21796(JOIN::exec_inner())[0x558d799cfc2d]
      sql/sql_select.cc:4664(JOIN::exec())[0x558d799cff47]
      sql/sql_select.cc:5145(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*))[0x558d799cdfcd]
      sql/sql_select.cc:588(handle_select(THD*, LEX*, select_result*, unsigned long long))[0x558d799ce75f]
      sql/sql_parse.cc:6290(execute_sqlcom_select(THD*, TABLE_LIST*))[0x558d7994e080]
      sql/sql_parse.cc:3961(mysql_execute_command(THD*, bool))[0x558d7995a845]
      sql/sql_parse.cc:8048(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x558d7995bd05]
      sql/sql_parse.cc:1896(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x558d7995dc35]
      sql/sql_parse.cc:1407(do_command(THD*, bool))[0x558d7995f247]
      sql/sql_connect.cc:1416(do_handle_one_connection(CONNECT*, bool))[0x558d79a72bf7]
      sql/sql_connect.cc:1318(handle_one_connection)[0x558d79a72f8d]
      perfschema/pfs.cc:2204(pfs_spawn_thread)[0x558d79d8c440]
      /lib/x86_64-linux-gnu/libc.so.6(+0x89134)[0x7fa1ed686134]
      /lib/x86_64-linux-gnu/libc.so.6(+0x1097dc)[0x7fa1ed7067dc]
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7fa1c40117b0): SELECT user.id AS user_id, user.username AS user_username, user.name AS user_name, user.password AS user_password, user.must_change_password AS user_must_change_password, user.email AS user_email, user.scope AS user_scope, user.idp_id AS user_idp_id, user._idp_id AS user__idp_id, user.idp_refreshed AS user_idp_refreshed, user.disabled AS user_disabled, user.service AS user_service
      FROM user
      WHERE user.username = 'user1' AND user.idp_id = 1
       LIMIT 1 FOR UPDATE
      Connection ID (thread ID): 34
      Status: NOT_KILLED
      Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
      The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mariadbd/ contains
      information that should help you find out what is causing the crash.
      Writing a core file...
      Working directory at /storage/mysql
      Resource Limits:
      Limit                     Soft Limit           Hard Limit           Units
      Max cpu time              unlimited            unlimited            seconds
      Max file size             unlimited            unlimited            bytes
      Max data size             unlimited            unlimited            bytes
      Max stack size            8388608              unlimited            bytes
      Max core file size        unlimited            unlimited            bytes
      Max resident set          unlimited            unlimited            bytes
      Max processes             15418                15418                processes
      Max open files            32768                32768                files
      Max locked memory         524288               524288               bytes
      Max address space         unlimited            unlimited            bytes
      Max file locks            unlimited            unlimited            locks
      Max pending signals       15418                15418                signals
      Max msgqueue size         819200               819200               bytes
      Max nice priority         0                    0
      Max realtime priority     0                    0
      Max realtime timeout      unlimited            unlimited            us
      Core pattern: core
      Kernel version: Linux version 6.1.0-17-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian 6.1.69-1 (2023-12-30)
      

      Attachments

        Issue Links

          Activity

            People

              debarun Debarun Banerjee
              cziebuhr Christoph Ziebuhr
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.