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

BLACKHOLE index limited to 1000 bytes: "Specified key was too long; max key length is 1000 bytes"

Details

    Description

      (filed under Storage Engine - InnoDB because there is no component "Storage Engine - Blackhole", but it affects InnoDB compatibility)

      Previous versions of InnoDB had a max index length of <1KB. Most modern versions of MariaDB increase that to 3KB+ (the innodb_large_prefix option).

      Blackhole, while it is not an engine enabled by default on MariaDB, it is still shipped with it, and may have some limited usage for which it would be useful, even if can create many issues. One of the usages is to replicate to a separate server but ignore all data. However, there is a big compatibility issue between InnoDB and blackhole, and that is that indexes on Blackhole cannot be larger than 1KB.

      max index length for Blackwhole is an arbitrary constant (https://github.com/MariaDB/server/blob/10.6/storage/blackhole/ha_blackhole.h#L70 ), and increasing it is very simple (no complex data to manage), but Oracle MySQL ignored the upstream bug report: https://bugs.mysql.com/bug.php?id=53588
      Percona has applied such a patch: https://github.com/percona/percona-server/pull/2000 , and it has already a 3KB limit. I don't see a reason not to apply the same patch (or a similar, it is a one line change + tests) as it would improve compatibility, not break it.

      Attachments

        Activity

          danblack Daniel Black added a comment -

          Sure, seems easy.

          10.5 still exposes 3500 with the comment:

          For page sizes = 16k, InnoDB historically reported 3500 bytes here,
          But the MySQL limit of 3072 was always used through the handler
          interface.

          Changing MAX_KEY also in the patch seems easy enough as this defaults to the current 64, though is compile time configurable to 127/8.

          Testing https://github.com/MariaDB/server/commit/4fa6638031d968c955f224bf1d71ea1e80648ecf

          danblack Daniel Black added a comment - Sure, seems easy. 10.5 still exposes 3500 with the comment: For page sizes = 16k, InnoDB historically reported 3500 bytes here, But the MySQL limit of 3072 was always used through the handler interface. Changing MAX_KEY also in the patch seems easy enough as this defaults to the current 64, though is compile time configurable to 127/8. Testing https://github.com/MariaDB/server/commit/4fa6638031d968c955f224bf1d71ea1e80648ecf
          danblack Daniel Black added a comment -

          pushed. Thanks for the bug report.

          danblack Daniel Black added a comment - pushed. Thanks for the bug report.

          That was fast! Thank you very much!

          marostegui Manuel Arostegui added a comment - That was fast! Thank you very much!

          People

            danblack Daniel Black
            jcrespo Jaime Crespo
            Votes:
            1 Vote for this issue
            Watchers:
            4 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.