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

engine attributes in partitioning is broken

    XMLWordPrintable

Details

    • Bug
    • Status: In Testing (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6, 10.11, 11.4, 11.8
    • 12.2
    • Partitioning, Plugins
    • None
    • Not for Release Notes

    Description

      For not partitioned tables, engines currently read options from table->s->option_struct.
      This doesn't work, if different partitions can have different options, because they share the same TABLE. For this reason option_struct is also stored per partition and per subpartition in partition_element. For engines to be able to find options without detecting what partition or subpartition it belongs to (some do that!), ha_partition does

        tbl->s->connect_string= part_elem->connect_string;
        if (part_elem->option_list)
          tbl->s->option_list= part_elem->option_list;
        if (part_elem->option_struct)
          tbl->s->option_struct= part_elem->option_struct;
      

      before invoking handler::ha_create of an individual partition.

      This obviously can only work during creation, but an engine can technically consult its option_struct any time and when a TABLE_SHARE is used concurrently by many threads it cannot have its TABLE_SHARE::option_struct pointing to some individual partition. Same problem with the connect_string.

      Let's

      • rename TABLE_SHARE::option_struct to option_struct_table to emphasize that it's options for the whole table (and catch incorrect usages of it)
      • rename partition_element::option_struct to option_struct_part, ditto
      • introduce handler::option_struct which will point to option_struct_table or option_struct_part as appropriate, the handler can use it any time as needed. A handler should not use option_struct_table unless it really knows what it's doing and has verified that it doesn't break partitioning.
      • move connect_string into option_struct

      Attachments

        Issue Links

          Activity

            People

              Roel Roel Van de Paar
              serg Sergei Golubchik
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.